Skip to content

Commit

Permalink
Save over 50% of logfile 'bloat' by not repeating all args on success…
Browse files Browse the repository at this point in the history
…/failure

The data will be right above it just before we run the job.
  • Loading branch information
lamby committed Mar 8, 2014
1 parent 078bcbf commit df216bd
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions django_lightweight_queue/middleware/logging.py
Expand Up @@ -10,15 +10,13 @@ def process_job(self, job):
log.info("Running job %s", job)

def process_result(self, job, result, duration):
log.info("Finished job %s => %r (Time taken: %.2fs)",
job,
log.info("Finished job => %r (Time taken: %.2fs)",
result,
duration,
)

def process_exception(self, job, duration, *exc_info):
log.error("Exception when processing %r (duration: %.2fs): %s",
job,
log.error("Exception when processing job (duration: %.2fs): %s",
duration,
''.join(traceback.format_exception(*exc_info)),
)

0 comments on commit df216bd

Please sign in to comment.