flake8 compliant
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
from dotenv import load_dotenv
|
||||
import logging
|
||||
import os
|
||||
from configparser import ConfigParser
|
||||
from pathlib import Path
|
||||
from typing import Literal
|
||||
@@ -15,12 +14,19 @@ LOGGER_LEVEL = config.get('main', 'logger_level')
|
||||
def setup_logging(
|
||||
logger_level: Literal['debug', 'info', 'warning', 'error'] = LOGGER_LEVEL
|
||||
):
|
||||
fmt = '%(asctime)s | %(levelname)s | %(filename)s | %(funcName)s | %(message)s'
|
||||
fmt = (
|
||||
'%(asctime)s | '
|
||||
'%(levelname)s | '
|
||||
'%(filename)s | '
|
||||
'%(funcName)s | '
|
||||
'%(message)s'
|
||||
)
|
||||
datefmt = '%Y-%m-%d %H:%M:%S'
|
||||
level = getattr(logging, logger_level.upper())
|
||||
logging.basicConfig(format=fmt, datefmt=datefmt, level=level)
|
||||
logging.debug('finished')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
load_dotenv('dev.env')
|
||||
setup_logging()
|
||||
setup_logging()
|
||||
|
||||
Reference in New Issue
Block a user