diff options
author | Fabrice Douchant <Fabrice.Douchant@logilab.fr> | 2008-10-15 11:06:58 +0200 |
---|---|---|
committer | Fabrice Douchant <Fabrice.Douchant@logilab.fr> | 2008-10-15 11:06:58 +0200 |
commit | 70b5d2c6b2df03022417358c79a5e171ab0386d6 (patch) | |
tree | dd3ba6292c2aab5f84867cef6cafe74f4b54edd4 | |
parent | 9e229b4e42e4cdb165f48457958f4d76a1443700 (diff) | |
parent | 872200e33f0225f78d1c4d49480be139c03025d1 (diff) | |
download | logilab-common-70b5d2c6b2df03022417358c79a5e171ab0386d6.tar.gz |
merge
-rw-r--r-- | logging_ext.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/logging_ext.py b/logging_ext.py index 0012f0b..b788c00 100644 --- a/logging_ext.py +++ b/logging_ext.py @@ -20,8 +20,8 @@ class ColorFormatter(logging.Formatter): """ A color Formatter for the logging standard module. - By default, colorize CRITICAL and ERROR in red, WARNING in orange - and INFO in yellow. + By default, colorize CRITICAL and ERROR in red, WARNING in orange, INFO in + green and DEBUG in yellow. self.colors is customizable via the 'color' constructor argument (dictionnary). @@ -35,12 +35,13 @@ class ColorFormatter(logging.Formatter): self.colors = {'CRITICAL': 'red', 'ERROR': 'red', 'WARNING': 'magenta', - 'INFO': 'yellow', + 'INFO': 'green', + 'DEBUG': 'yellow', } if colors is not None: assert isinstance(colors, dict) - self.colors.update(colors) - + self.colors.update(colors) + def format(self, record): msg = logging.Formatter.format(self, record) if record.levelname in self.colors: |