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.
 
 

29 lines
816 B

from time import strftime
class colors:
HEADER = u'\033[95m'
OKBLUE = u'\033[94m'
OKGREEN = u'\033[92m'
WARNING = u'\033[93m'
FAIL = u'\033[91m'
ENDC = u'\033[0m'
BOLD = u'\033[1m'
UNDERLINE = u'\033[4m'
HEADER = u"[{:^7}] ({:^17}) {}"
def ok(text):
HEAD = colors.OKGREEN + u"OK" + colors.ENDC
return print(HEADER.format(HEAD, strftime(u"%H:%M:%S %d.%m.%y"), text))
def error(text):
HEAD = colors.FAIL + u"FAIL" + colors.ENDC
return print(HEADER.format(HEAD, strftime(u"%H:%M:%S %d.%m.%y"), text))
def warning(text):
HEAD = colors.WARNING + u"WARNING" + colors.ENDC
return print(HEADER.format(HEAD, strftime(u"%H:%M:%S %d.%m.%y"), text))
def info(text):
HEAD = colors.HEADER + u"INFO" + colors.ENDC
return print(HEADER.format(HEAD, strftime(u"%H:%M:%S %d.%m.%y"), text))