|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
import datetime
from logsystem import LogSystem
BASH_YLW_TEXT = '\033[33m'
BASH_RED_TEXT = '\033[31m'
BASH_RESET_TEXT = '\033[0m'
class ConsoleLogger(LogSystem):
def writeLog(self,message,module,type = None):
if(type == None):
type = self.TYPE_INFO
time = str(datetime.datetime.now())
if(type == self.TYPE_ERROR):
print(time + " [" + module + "] " + BASH_RED_TEXT + "ERROR: " + message + BASH_RESET_TEXT)
elif(type == self.TYPE_WARNING):
print(time + " [" + module + "] " + BASH_YLW_TEXT + "WARNING: " + message + BASH_RESET_TEXT)
elif(type == self.TYPE_INFO):
print(time + " [" + module + "] " + "INFO: " + message)
else:
print(message)
|