Commit 710b994a authored by Marco Clemencic's avatar Marco Clemencic
Browse files

avoid creation of log file for EnvConfig

disabled the default file-based logging in EnvConfig/log.conf
parent 45228035
......@@ -2,7 +2,8 @@
keys=root,envLogger
[handlers]
keys=consoleHandler,fileHandler
#keys=consoleHandler,fileHandler
keys=consoleHandler
[formatters]
keys=simpleFormatter
......@@ -13,7 +14,8 @@ handlers=consoleHandler
[logger_envLogger]
level=DEBUG
handlers=consoleHandler,fileHandler
#handlers=consoleHandler,fileHandler
handlers=consoleHandler
qualname=envLogger
propagate=0
......@@ -23,11 +25,11 @@ level=CRITICAL
formatter=simpleFormatter
args=(sys.stdout,)
[handler_fileHandler]
class=FileHandler
level=DEBUG
formatter=simpleFormatter
args=('envLib.log', 'w')
#[handler_fileHandler]
#class=FileHandler
#level=DEBUG
#formatter=simpleFormatter
#args=('envLib.log', 'w')
[formatter_simpleFormatter]
format=%(asctime)s - %(name)s - %(levelname)s - %(message)s
\ No newline at end of file
format=%(asctime)s - %(name)s - %(levelname)s - %(message)s
......@@ -15,8 +15,9 @@ class XMLFile():
def __init__(self):
self.xmlResult = '<?xml version="1.0" encoding="UTF-8"?><env:config xmlns:env="EnvSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="EnvSchema ./EnvSchema.xsd ">\n'
self.declaredVars = []
if len(logging.getLogger('envLogger').handlers) < 1:
logging.config.fileConfig(os.path.normpath(os.path.dirname(os.path.realpath(__file__)) + '/log.conf'))
logConf = os.path.normpath(os.path.dirname(os.path.realpath(__file__)) + '/log.conf')
if not logging.getLogger('envLogger').handlers and os.path.exists(logConf):
logging.config.fileConfig(logConf)
self.logger = logging.getLogger('envLogger')
......@@ -103,8 +104,9 @@ class Report():
else:
self.reportOutput = open(reportOutput, 'w')
if len(logging.getLogger('envLogger').handlers) < 1:
logging.config.fileConfig(os.path.normpath(os.path.dirname(os.path.realpath(__file__)) + '/log.conf'))
logConf = os.path.normpath(os.path.dirname(os.path.realpath(__file__)) + '/log.conf')
if not logging.getLogger('envLogger').handlers and os.path.exists(logConf):
logging.config.fileConfig(logConf)
self.logger = logging.getLogger('envLogger')
def addError(self, message, varName = '', action = '', varValue = '', procedure = ''):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment