diff options
author | Tulio Casagrande <tcasagra@thoughtworks.com> | 2017-02-07 14:43:11 -0200 |
---|---|---|
committer | Tulio Casagrande <tcasagra@thoughtworks.com> | 2017-02-07 14:43:11 -0200 |
commit | 674999874136714be031db8c31432eb2a4d50c2e (patch) | |
tree | 348267c3dc79d4198cb2fffd0d28c5a6b0317235 /service/pixelated | |
parent | 15725dc3eea9b7389ee22d406094bb7d22af1364 (diff) |
[#952] Access log_format key correctly even if it's None
This is the case of the infamous 'Unhandled error in Deferred' events
that were not logging the traceback.
Diffstat (limited to 'service/pixelated')
-rw-r--r-- | service/pixelated/config/logger.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/service/pixelated/config/logger.py b/service/pixelated/config/logger.py index a1e825a6..c4d2dc76 100644 --- a/service/pixelated/config/logger.py +++ b/service/pixelated/config/logger.py @@ -44,9 +44,9 @@ def init(debug=False): def formatter(event): event['log_time'] = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(event['log_time'])) event['log_level'] = event['log_level'].name.upper() + event['log_format'] = event.get('log_format') or '' logstring = u'{log_time} [{log_namespace}] {log_level} ' + event['log_format'] + '\n' return logstring.format(**event) observers = [FileLogObserver(sys.stdout, formatter)] - globalLogBeginner.beginLoggingTo(observers) |