log to file
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import datetime
|
||||
import logging
|
||||
from pathlib import Path
|
||||
|
||||
LOGS_DIR = str(Path.home())
|
||||
|
||||
|
||||
def init_logger():
|
||||
logging.basicConfig(filename=LOGS_DIR + "/request_{}.log".format(str(datetime.date.today())),
|
||||
filemode='a',
|
||||
format='%(asctime)s,%(msecs)d %(name)s %(levelname)s %(message)s',
|
||||
datefmt='%Y-%m-%d %H:%M:%S',
|
||||
level=logging.INFO)
|
||||
Reference in New Issue
Block a user