mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Set Log level by env (#3798)
### What problem does this PR solve? Set Log level by env ### Type of change - [x] Refactoring
This commit is contained in:
@ -19,15 +19,10 @@
|
||||
# beartype_all(conf=BeartypeConf(violation_type=UserWarning)) # <-- emit warnings from all code
|
||||
|
||||
import logging
|
||||
import os
|
||||
from api.utils.log_utils import initRootLogger
|
||||
initRootLogger("ragflow_server")
|
||||
for module in ["pdfminer"]:
|
||||
module_logger = logging.getLogger(module)
|
||||
module_logger.setLevel(logging.WARNING)
|
||||
for module in ["peewee"]:
|
||||
module_logger = logging.getLogger(module)
|
||||
module_logger.handlers.clear()
|
||||
module_logger.propagate = True
|
||||
LOG_LEVELS = os.environ.get("LOG_LEVELS", "")
|
||||
initRootLogger("ragflow_server", LOG_LEVELS)
|
||||
|
||||
import os
|
||||
import signal
|
||||
|
||||
Reference in New Issue
Block a user