pgtoolkit/coloredformatter.py
changeset 83 515fadd3d286
parent 82 7b82dc1fb6f5
child 84 3b5dd9efba35
--- a/pgtoolkit/coloredformatter.py	Wed Apr 10 11:22:15 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-import logging
-
-from pgtoolkit import highlight
-
-
-class ColoredFormatter(logging.Formatter):
-    def __init__(self, fmt, datefmt):
-        logging.Formatter.__init__(self, fmt, datefmt)
-
-    def format(self, record):
-        color = ()
-        if record.levelno == logging.ERROR and record.exc_info is not None:
-            color = (11, 1)
-        if color:
-            origmsg = record.msg
-            f,b = color
-            record.msg = highlight(1, f, b) + record.msg + highlight(0)
-            res = logging.Formatter.format(self, record)
-            record.msg = origmsg
-        else:
-            res = logging.Formatter.format(self, record)
-        return res
-