From c97ce70ba7220e3a5652043ea9ce111d1b137d33 Mon Sep 17 00:00:00 2001 From: "P. Christeas" Date: Sun, 28 Sep 2008 19:33:34 +0300 Subject: [PATCH] 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 --- bin/netsvc.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/netsvc.py b/bin/netsvc.py index e67fcea9c58..968958d5e10 100644 --- a/bin/netsvc.py +++ b/bin/netsvc.py @@ -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