def error(self, message, *args, **kwargs):
        """Log error with stack trace and locals information.

        By default, enables stack trace information in logging messages, so that stacktrace and locals appear in Sentry.
        """
        kwargs.setdefault('extra', {}).setdefault('stack', True)
        return self.logger.error(message, *args, **kwargs)
def error ( self , message , * args , ** kwargs ) : kwargs . setdefault ( 'extra' , { } ) . setdefault ( 'stack' , True ) return self . logger . error ( message , * args , ** kwargs )
Log error with stack trace and locals information.

        By default, enables stack trace information in logging messages, so that stacktrace and locals appear in Sentry.