0

Windows code for fancy colors

This commit is contained in:
Andrew Chin
2011-10-31 22:33:49 -04:00
parent 1d077fe34e
commit 6a67841b44
2 changed files with 133 additions and 6 deletions

View File

@@ -109,11 +109,11 @@ helptext = """
def configure_logger():
# Configure the root logger to our liking
logger = logging.getLogger()
handler = logging.StreamHandler(sys.stderr)
handler = util.OverviewerHandler(sys.stdout)
if platform.system() == 'Windows':
# Windows logging for windows terminals
# TODO (this is a placeholder)
formatter = util.DumbFormatter()
# Our custom OverviewerHandler knows how to deal with select
# ANSI color escape sequences
formatter = util.ANSIColorFormatter()
elif sys.stderr.isatty():
# terminal logging with ANSI color
formatter = util.ANSIColorFormatter()