diff --git a/rq/logutils.py b/rq/logutils.py index 2d849c1..324553b 100644 --- a/rq/logutils.py +++ b/rq/logutils.py @@ -20,7 +20,9 @@ def setup_loghandlers(level=None, date_format=DEFAULT_LOGGING_DATE_FORMAT, logger.addHandler(handler) if level is not None: - logger.setLevel(level) + # The level may be a numeric value (e.g. when using the logging module constants) + # Or a string representation of the logging level + logger.setLevel(level if isinstance(level, int) else level.upper()) def _has_effective_handler(logger): diff --git a/rq/worker.py b/rq/worker.py index 50d1733..7e090f5 100644 --- a/rq/worker.py +++ b/rq/worker.py @@ -210,7 +210,7 @@ class Worker(object): self.disable_default_exception_handler = disable_default_exception_handler - if isinstance(exception_handlers, list): + if isinstance(exception_handlers, (list, tuple)): for handler in exception_handlers: self.push_exc_handler(handler) elif exception_handlers is not None: