v1.0.0b1
This commit is contained in:
16
logger.py
Normal file
16
logger.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import logging
|
||||
|
||||
from main import logfile
|
||||
|
||||
# Setup Logging
|
||||
logging.basicConfig(filename=logfile,
|
||||
encoding="utf-8",
|
||||
filemode="a",
|
||||
format="%(asctime)s %(name)s %(levelname)s %(message)s",
|
||||
datefmt="%Y-%m-%d %H:%M:%S",
|
||||
level=logging.INFO)
|
||||
|
||||
# Logging handler
|
||||
## DEBUG (10), INFO (20), WARNING (30), ERROR (40), and CRITICAL (50)
|
||||
def log(msg: str, level=20):
|
||||
logging.log(level=level, msg=msg)
|
||||
Reference in New Issue
Block a user