From: Pierre Date: Sun, 13 Jan 2013 20:50:39 +0000 (+0100) Subject: ... X-Git-Url: http://iramuteq.org/git?a=commitdiff_plain;h=07808c0994b4f7d3ffadcb8c862e478af0141238;p=iramuteq ... --- diff --git a/iramuteq.py b/iramuteq.py index c59894b..af6c521 100644 --- a/iramuteq.py +++ b/iramuteq.py @@ -128,16 +128,25 @@ ch = logging.StreamHandler() formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s') ch.setFormatter(formatter) fh.setFormatter(formatter) -log.addHandler(ch) log.addHandler(fh) +if sys.platform != 'win32' or sys.platform != 'darwin': + log.addHandler(ch) log.setLevel(logging.INFO) class writer(object): def write(self, data): if data.strip() != '' : - log.info('BUG : %s' % data) + log.info('ERROR : %s' % data) + +class printer(object) : + def write(self, data) : + if data.strip() != '' : + log.info('Print : %s' % data) + sys.stderr = writer() +sys.stdout = printer() + ConfigPath = ConstructConfigPath(UserConfigPath) #####################################################################