code: def exception(self, msg, *args, **kwargs):
          
          extra = kwargs.setdefault('extra', {})
          extra['exc_fullstack'] = self.isEnabledFor(logging.DEBUG)
          kwargs['exc_info'] = True
          self.log(logging.ERROR, msg, *args, **kwargs)
docs: Like standard exception() logger but only print stack in debug mode