From bd08f24f15ac40f2bea51f63305d3fbdfa5ad560 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Tue, 14 Feb 2012 17:53:28 +0100 Subject: [PATCH] Cosmetic changes to the command line output. --- rq/worker.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rq/worker.py b/rq/worker.py index 94420fec..6c4eb430 100644 --- a/rq/worker.py +++ b/rq/worker.py @@ -21,6 +21,7 @@ from .exceptions import NoQueueError, UnpickleError green = make_colorizer('darkgreen') yellow = make_colorizer('darkyellow') +red = make_colorizer('darkred') blue = make_colorizer('darkblue') @@ -328,8 +329,8 @@ class Worker(object): rv = job.perform() except Exception as e: fq = self.failed_queue - self.log.exception(e) - self.log.warning('Moving job to %s queue.' % (fq.name,)) + self.log.exception(red(str(e))) + self.log.warning('Moving job to %s queue.' % fq.name) # Store the exception information... job.ended_at = times.now() @@ -341,7 +342,7 @@ class Worker(object): if rv is None: self.log.info('Job OK') else: - self.log.info('Job OK, result = %s' % (yellow(rv),)) + self.log.info('Job OK, result = %s' % (yellow(unicode(rv)),)) if rv is not None: p = conn.pipeline() p.hset(job.key, 'result', dumps(rv))