diff --git a/rq/logutils.py b/rq/logutils.py index 35af585..aeb2c8f 100644 --- a/rq/logutils.py +++ b/rq/logutils.py @@ -7,7 +7,7 @@ import logging from rq.utils import ColorizingStreamHandler -def setup_loghandlers(level='INFO'): +def setup_loghandlers(level): logger = logging.getLogger('rq.worker') if not _has_effective_handler(logger): logger.setLevel(level) diff --git a/rq/worker.py b/rq/worker.py index ac48bf5..3881567 100644 --- a/rq/worker.py +++ b/rq/worker.py @@ -407,7 +407,7 @@ class Worker(object): if before_state: self.set_state(before_state) - def work(self, burst=False): + def work(self, burst=False, logging_level=logging.INFO): """Starts the work loop. Pops and performs all jobs on the current list of queues. When all @@ -416,7 +416,7 @@ class Worker(object): The return value indicates whether any jobs were processed. """ - setup_loghandlers() + setup_loghandlers(logging_level) self._install_signal_handlers() did_perform_work = False