Fix logger issues.

First, we have to import logger.handlers. Second, the logic behind
enabling the colors was reversed, so that escapes don't show up in
the file.

bzr revid: p_christ@hol.gr-20080928163334-pibi94nvkan0xr9e
This commit is contained in:
P. Christeas 2008-09-28 19:33:34 +03:00
parent d3766694a7
commit c97ce70ba7
1 changed files with 2 additions and 1 deletions

View File

@ -35,6 +35,7 @@ import SimpleXMLRPCServer, signal, sys, xmlrpclib
import SocketServer
import socket
import logging
import logging.handlers
import os
_service = {}
@ -177,7 +178,7 @@ def init_logger():
logging.getLogger().addHandler(handler)
logging.getLogger().setLevel(logging.INFO)
if isinstance(handler, logging.StreamHandler) and os.name != 'nt':
if (not isinstance(handler, logging.FileHandler)) and os.name != 'nt':
# change color of level names
# uses of ANSI color codes
# see http://pueblo.sourceforge.net/doc/manual/ansi_color_codes.html