summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Jehannet <julien.jehannet@logilab.fr>2008-10-13 20:01:18 +0200
committerJulien Jehannet <julien.jehannet@logilab.fr>2008-10-13 20:01:18 +0200
commit872200e33f0225f78d1c4d49480be139c03025d1 (patch)
tree5ac9bcdb9550549d674c06b71cc064ca263e3f8b
parent87ee3e314de58b2a9be4de73a71fdc403f758c73 (diff)
parentbafc1843f598db1d4869aa1e574891c48720a05e (diff)
downloadlogilab-common-872200e33f0225f78d1c4d49480be139c03025d1.tar.gz
(merge)
-rw-r--r--logging_ext.py11
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: