summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2011-11-21 18:15:15 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2011-11-21 18:15:15 +0100
commit74ae6bdb18ee1a0bef0757784b4d701b0a08a6fd (patch)
treee00f86c9f28f33ebeba18320fa92cd98c2f1c44b
parentf37e3435eaacef0390c46f61641fda06f664fa21 (diff)
downloadpykolab-74ae6bdb18ee1a0bef0757784b4d701b0a08a6fd.tar.gz
Close stdout when removing the handler
-rw-r--r--pykolab/logger.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/pykolab/logger.py b/pykolab/logger.py
index 55dd9bd..e154558 100644
--- a/pykolab/logger.py
+++ b/pykolab/logger.py
@@ -17,7 +17,6 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
-import inspect
import logging
import logging.handlers
import os
@@ -27,13 +26,18 @@ import time
from pykolab.translate import _
class Logger(logging.Logger):
+ """
+ The PyKolab version of a logger.
+
+ This class wraps the Python native logging library, adding to the
+ loglevel capabilities, a debuglevel capability.
+ """
debuglevel = 0
loglevel = logging.CRITICAL
for arg in sys.argv:
if debuglevel == -1:
debuglevel = int(arg)
- #print debuglevel
loglevel = logging.DEBUG
break
if '-d' == arg:
@@ -84,6 +88,7 @@ class Logger(logging.Logger):
pass
def remove_stdout_handler(self):
+ self.console_stdout.close()
self.removeHandler(self.console_stdout)
def debug(self, msg, level=1):