code refactoring and first time logger is handled by a separate file descriptor (issue #297)

This commit is contained in:
Bernardo Damele
2012-12-15 00:12:22 +00:00
parent 2f6a31605c
commit 0c3da5c7eb
3 changed files with 63 additions and 41 deletions

View File

@@ -6,6 +6,7 @@ See the file 'doc/COPYING' for copying permission
"""
import logging
import StringIO
import sys
from lib.core.enums import CUSTOM_LOGGING
@@ -32,3 +33,6 @@ FORMATTER = logging.Formatter("\r[%(asctime)s] [%(levelname)s] %(message)s", "%H
LOGGER_HANDLER.setFormatter(FORMATTER)
LOGGER.addHandler(LOGGER_HANDLER)
LOGGER.setLevel(logging.WARN)
# to handle logger with the RESTful API
LOGGER_OUTPUT = StringIO.StringIO()