|
17 | 17 |
|
18 | 18 |
|
19 | 19 | # logging defaults |
| 20 | +DT_FORMAT = "%Y-%m-%d %H:%M:%S.%f" |
20 | 21 | LOG_FORMAT = '%(asctime)s - %(filename)s - %(levelname)s - %(message)s' |
21 | 22 | LOG_LEVEL = logging.ERROR |
22 | 23 | LOG_MAX_BYTES = 2000000 |
@@ -45,7 +46,7 @@ def __init__(self, name:str, level:int=0): |
45 | 46 | ''' |
46 | 47 | Setup log with custom settings. |
47 | 48 | ''' |
48 | | - def configure(self, logfile:str, name:str, dtformat="%Y-%m-%d %H:%M:%S.%f", level:str=LOG_LEVEL, |
| 49 | + def configure(self, logfile:str, name:str, dtformat=DT_FORMAT, level:str=LOG_LEVEL, |
49 | 50 | maxbytes=LOG_MAX_BYTES, backupcount=LOG_BACKUP_COUNT, |
50 | 51 | logformat=LOG_FORMAT, errorcode=ec.errorcode): |
51 | 52 |
|
@@ -93,13 +94,13 @@ def error(self, msg:str): |
93 | 94 |
|
94 | 95 |
|
95 | 96 | def warning(self, msg:str): |
96 | | - logging.Logger.error(self, msg) |
| 97 | + logging.Logger.warning(self, msg) |
97 | 98 | if self.level <= logging.WARNING: |
98 | 99 | print(f"{colorama.Fore.YELLOW}{msg}{colorama.Style.RESET_ALL}") |
99 | 100 |
|
100 | 101 |
|
101 | 102 | def warn(self, msg:str): |
102 | | - logging.Logger.error(self, msg) |
| 103 | + logging.Logger.warning(self, msg) |
103 | 104 | if self.level <= logging.WARN: |
104 | 105 | print(f"{colorama.Fore.YELLOW}{msg}{colorama.Style.RESET_ALL}") |
105 | 106 |
|
|
0 commit comments