From d9ef1dc567c9e5f7f28238fdd98bf19dd08b42e7 Mon Sep 17 00:00:00 2001 From: chrys87 Date: Fri, 8 Jul 2016 12:06:09 +0200 Subject: [PATCH] change structure --- src/fenrir-package/utils/debug.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/fenrir-package/utils/debug.py b/src/fenrir-package/utils/debug.py index 971e22db..c41d9827 100644 --- a/src/fenrir-package/utils/debug.py +++ b/src/fenrir-package/utils/debug.py @@ -22,21 +22,21 @@ class debug(): self.file = open(self._fileName,'w') self._fileOpened = True - def writeDebugOut(self, envirionment, text): - if not envirionment['generalInformation']['debugEnabled']: + def writeDebugOut(self, envirionment, text, level=ERROR): + if envirionment['generalInformation']['debugLevel']: if self._fileOpened: self.closeDebugFile() return else: if not self._fileOpened: self.openDebugFile() - self.writeLog(environment, text): + self.writeLog(environment, text, level): - def writeLog(self, environment, text): - if not self._fileOpened: - return False + def writeLog(self, environment, text, level: if self._level < envirionment['generalInformation']['debugLevel']: return False + if not self._fileOpened: + return False self._file.write(text + '\n') return True