From 7140f77484c083d51cc81e4d238307cd413c6674 Mon Sep 17 00:00:00 2001 From: nir0s Date: Mon, 26 Mar 2018 08:32:53 +0300 Subject: [PATCH] Lazily evaluate a logging call --- CHANGES | 3 +++ wryte.py | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 4bfe8ed..cbab382 100644 --- a/CHANGES +++ b/CHANGES @@ -18,6 +18,9 @@ which I feel is ready for day to day use. * Support passing kwarg type context to all logging methods (i.e. `wryter.error('Message', k=v)`. * Add OOB support (with optional dependencies) for Elasticsearch, Logzio, Syslog and File handlers. * Expose handler configuration via env vars. +* Add many tests +* Add codeclimate checks +* Try to avoid exceptions in the logger as much as possible. Instead, display errors or exceptions in the console. See the docs for more info. diff --git a/wryte.py b/wryte.py index ea37326..abb2688 100644 --- a/wryte.py +++ b/wryte.py @@ -333,8 +333,7 @@ def _assert_level(self, level): levels = LEVEL_CONVERSION.keys() if level.lower() not in levels: - self.logger.exception('Level must be one of {0}'.format( - levels)) + self.logger.exception('Level must be one of %s', levels) return False return True