14 lines
262 B
Python
14 lines
262 B
Python
|
from enum import Enum
|
||
|
from datetime import datetime
|
||
|
import aiohttp
|
||
|
|
||
|
DEBUG = True
|
||
|
|
||
|
class Severity(Enum):
|
||
|
MESSAGE = 'M'
|
||
|
WARNING = 'W'
|
||
|
ERROR = 'E'
|
||
|
|
||
|
def log(message, severity=Severity.MESSAGE):
|
||
|
if DEBUG:
|
||
|
print(f'{datetime.now()}: [{severity.value}] {message}')
|