Update debug.py
This commit is contained in:
parent
1cc8bc4ddf
commit
ff18278921
@ -2,6 +2,7 @@
|
|||||||
# Debugger module for the Fenrir screen reader.
|
# Debugger module for the Fenrir screen reader.
|
||||||
|
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
import time
|
||||||
|
|
||||||
class debugLevel(Enum):
|
class debugLevel(Enum):
|
||||||
DEACTIVE = 0
|
DEACTIVE = 0
|
||||||
@ -10,6 +11,8 @@ class debugLevel(Enum):
|
|||||||
INFO = 3
|
INFO = 3
|
||||||
def __int__(self):
|
def __int__(self):
|
||||||
return self.value
|
return self.value
|
||||||
|
def __str__(self):
|
||||||
|
return self.name
|
||||||
|
|
||||||
class debug():
|
class debug():
|
||||||
def __init__(self, fileName='/var/log/fenrir.log'):
|
def __init__(self, fileName='/var/log/fenrir.log'):
|
||||||
@ -39,7 +42,7 @@ class debug():
|
|||||||
else:
|
else:
|
||||||
if not self._fileOpened:
|
if not self._fileOpened:
|
||||||
self.openDebugFile()
|
self.openDebugFile()
|
||||||
self._file.write(text + '\n')
|
self._file.write(str(level) +': ' + str(time.time()) + ' ' + text + '\n')
|
||||||
|
|
||||||
def closeDebugFile(self):
|
def closeDebugFile(self):
|
||||||
if not self._fileOpened:
|
if not self._fileOpened:
|
||||||
|
Loading…
Reference in New Issue
Block a user