diff options
author | Julien Jehannet <julien.jehannet@logilab.fr> | 2008-10-13 20:01:18 +0200 |
---|---|---|
committer | Julien Jehannet <julien.jehannet@logilab.fr> | 2008-10-13 20:01:18 +0200 |
commit | 872200e33f0225f78d1c4d49480be139c03025d1 (patch) | |
tree | 5ac9bcdb9550549d674c06b71cc064ca263e3f8b | |
parent | 87ee3e314de58b2a9be4de73a71fdc403f758c73 (diff) | |
parent | bafc1843f598db1d4869aa1e574891c48720a05e (diff) | |
download | logilab-common-872200e33f0225f78d1c4d49480be139c03025d1.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: |