update debugging
This commit is contained in:
parent
d9ef1dc567
commit
252a231c25
@ -8,7 +8,7 @@ WARNING = 2
|
|||||||
INFO = 3
|
INFO = 3
|
||||||
|
|
||||||
class debug():
|
class debug():
|
||||||
def __init__(self, fileName='/var/log/fenrir.log', level = ERROR):
|
def __init__(self, fileName='/var/log/fenrir.log', level = DEACTIVE):
|
||||||
self._level = level
|
self._level = level
|
||||||
self._fileName = fileName
|
self._fileName = fileName
|
||||||
self._file = ''
|
self._file = ''
|
||||||
@ -22,8 +22,8 @@ class debug():
|
|||||||
self.file = open(self._fileName,'w')
|
self.file = open(self._fileName,'w')
|
||||||
self._fileOpened = True
|
self._fileOpened = True
|
||||||
|
|
||||||
def writeDebugOut(self, envirionment, text, level=ERROR):
|
def writeDebugOut(self, envirionment, text, level = DEACTIVE):
|
||||||
if envirionment['generalInformation']['debugLevel']:
|
if self._level < level:
|
||||||
if self._fileOpened:
|
if self._fileOpened:
|
||||||
self.closeDebugFile()
|
self.closeDebugFile()
|
||||||
return
|
return
|
||||||
@ -33,7 +33,7 @@ class debug():
|
|||||||
self.writeLog(environment, text, level):
|
self.writeLog(environment, text, level):
|
||||||
|
|
||||||
def writeLog(self, environment, text, level:
|
def writeLog(self, environment, text, level:
|
||||||
if self._level < envirionment['generalInformation']['debugLevel']:
|
if self._level < level:
|
||||||
return False
|
return False
|
||||||
if not self._fileOpened:
|
if not self._fileOpened:
|
||||||
return False
|
return False
|
||||||
|
Loading…
Reference in New Issue
Block a user