From ac3919b86d59c92b0db36b2b83fd94a2138a53a8 Mon Sep 17 00:00:00 2001 From: chrys87 Date: Fri, 8 Jul 2016 12:20:49 +0200 Subject: [PATCH] change structure --- src/fenrir-package/utils/debug.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/fenrir-package/utils/debug.py b/src/fenrir-package/utils/debug.py index 69a27cd7..88b767d1 100644 --- a/src/fenrir-package/utils/debug.py +++ b/src/fenrir-package/utils/debug.py @@ -2,13 +2,14 @@ # Debugger module for the Fenrir screen reader. -DEACTIVE = 0 -ERROR = 1 -WARNING = 2 -INFO = 3 +class debugLevel(Enum): + DEACTIVE = 0 + ERROR = 1 + WARNING = 2 + INFO = 3 class debug(): - def __init__(self, fileName='/var/log/fenrir.log', level = DEACTIVE): + def __init__(self, fileName='/var/log/fenrir.log', level = debugLevel.DEACTIVE): self._level = level self._fileName = fileName self._file = '' @@ -22,7 +23,7 @@ class debug(): self.file = open(self._fileName,'w') self._fileOpened = True - def writeDebugOut(self, envirionment, text, level = DEACTIVE): + def writeDebugOut(self, envirionment, text, level = debugLevel.DEACTIVE): if envirionment['settings']['debugLevel'] < level: if self._fileOpened: self.closeDebugFile()