format etc
This commit is contained in:
@ -1,19 +1,18 @@
|
||||
import logging
|
||||
from logging.handlers import TimedRotatingFileHandler
|
||||
|
||||
logger = logging.getLogger('garflog')
|
||||
logger = logging.getLogger("garflog")
|
||||
logger.setLevel(logging.INFO)
|
||||
formatter=logging.Formatter(
|
||||
'%(asctime)s [%(levelname)s] %(message)s',
|
||||
datefmt='%Y-%m-%d %H:%M:%S'
|
||||
)
|
||||
formatter = logging.Formatter(
|
||||
"%(asctime)s [%(levelname)s] %(message)s", datefmt="%Y-%m-%d %H:%M:%S"
|
||||
)
|
||||
file_handler = TimedRotatingFileHandler(
|
||||
'garfbot.log',
|
||||
when='midnight',
|
||||
"garfbot.log",
|
||||
when="midnight",
|
||||
interval=1,
|
||||
backupCount=7,
|
||||
delay=True # Counter-intuitively, this will flush output immediately
|
||||
)
|
||||
delay=True, # Counter-intuitively, this will flush output immediately
|
||||
)
|
||||
file_handler.setFormatter(formatter)
|
||||
console_handler = logging.StreamHandler()
|
||||
console_handler.setFormatter(formatter)
|
||||
|
Reference in New Issue
Block a user