You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
654 B

class Log:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
def error(self, msg):
10 years ago
print(Log.FAIL + msg + Log.ENDC)
self.app.log.error(Log.FAIL + msg + Log.ENDC)
self.app.close(1)
def info(self, msg, end='\n'):
print(Log.OKBLUE + msg + Log.ENDC, end=end)
self.app.log.info(Log.OKBLUE + msg + Log.ENDC)
def warn(self, msg):
self.app.log.warn(Log.BOLD + msg + Log.ENDC)
def debug(self, msg):
self.app.log.debug(Log.HEADER + msg + Log.ENDC)