Implementation of an Issue #149

This commit is contained in:
Miroslav Stampar
2012-08-15 22:31:25 +02:00
parent f358ab2e73
commit 1af81c0de4
5 changed files with 17 additions and 2 deletions

View File

@@ -39,11 +39,12 @@ class ColorizingStreamHandler(logging.StreamHandler):
}
csi = '\x1b['
reset = '\x1b[0m'
disable_coloring = False
@property
def is_tty(self):
isatty = getattr(self.stream, 'isatty', None)
return isatty and isatty()
return isatty and isatty() and not self.disable_coloring
def emit(self, record):
try: