Like standard exception() logger but only print stack in debug mode

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