File size: 777 Bytes
7a61b58 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
import logging
import logging.config
from config import config
logger = logging.getLogger("tts_indic_server")
# https://www.youtube.com/watch?v=9L77QExPmI0
# https://docs.python.org/3/library/logging.config.html
logging_config = {
"version": 1, # required
"disable_existing_loggers": False,
"formatters": {
"simple": {"format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s"},
},
"handlers": {
"stdout": {
"class": "logging.StreamHandler",
"formatter": "simple",
"stream": "ext://sys.stdout",
},
},
"loggers": {
"root": {
"level": config.log_level.upper(),
"handlers": ["stdout"],
},
},
}
logging.config.dictConfig(logging_config)
|