diff --git a/logbasecommand/__init__.py b/logbasecommand/__init__.py index d18f409..3b93d0b 100644 --- a/logbasecommand/__init__.py +++ b/logbasecommand/__init__.py @@ -1 +1 @@ -__version__ = '0.0.2' +__version__ = "0.0.2" diff --git a/logbasecommand/base.py b/logbasecommand/base.py index 38ce567..237e835 100644 --- a/logbasecommand/base.py +++ b/logbasecommand/base.py @@ -14,8 +14,8 @@ class LogBaseCommand(BaseCommand): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - prefix = getattr(settings, 'LOGBASECOMMAND_PREFIX', None) or __name__ - self.logger = logging.getLogger(prefix + '.' + self.__module__.split('.')[-1]) + prefix = getattr(settings, "LOGBASECOMMAND_PREFIX", None) or __name__ + self.logger = logging.getLogger(prefix + "." + self.__module__.split(".")[-1]) def __handle_custom_std(self, ifstd, std, msg, *args): if ifstd: @@ -52,16 +52,19 @@ def log_exception(self, msg, *args, **kwargs): return self.logger.exception(msg, *args, **kwargs) def execute(self, *args, **options): - self.verbosity = options['verbosity'] + self.verbosity = options["verbosity"] self.logger.setLevel( - [logging.ERROR, max(self.logger.getEffectiveLevel(), logging.INFO), logging.DEBUG, logging.DEBUG][ - self.verbosity - ] + [ + logging.ERROR, + max(self.logger.getEffectiveLevel(), logging.INFO), + logging.DEBUG, + logging.DEBUG, + ][self.verbosity] ) - if options.get('stdout') is not None: + if options.get("stdout") is not None: self.custom_stdout = True - if options.get('stderr') is not None: + if options.get("stderr") is not None: self.custom_stderr = True super().execute(*args, **options)