diff --git a/rq/worker.py b/rq/worker.py index b7a158c..389ca77 100644 --- a/rq/worker.py +++ b/rq/worker.py @@ -10,12 +10,8 @@ except ImportError: import socket import signal import traceback +import logging from cPickle import dumps -try: - from logbook import Logger - Logger = Logger # Does nothing except it shuts up pyflakes annoying error -except ImportError: - from logging import Logger from .queue import Queue, get_failed_queue from .connections import get_current_connection from .utils import make_colorizer @@ -28,6 +24,8 @@ yellow = make_colorizer('darkyellow') red = make_colorizer('darkred') blue = make_colorizer('darkblue') +logger = logging.getLogger(__name__) + class StopRequested(Exception): pass @@ -109,7 +107,7 @@ class Worker(object): self._is_horse = False self._horse_pid = 0 self._stopped = False - self.log = Logger('worker') + self.log = logger self.failed_queue = get_failed_queue(connection=self.connection) @@ -363,7 +361,7 @@ class Worker(object): signal.signal(signal.SIGTERM, signal.SIG_DFL) self._is_horse = True - self.log = Logger('horse') + self.log = logger success = self.perform_job(job)