fix: respect user-specified log level in set_logger

Previously, the set_logger function would always set the log level to DEBUG, overriding any user-specified log level.
This commit is contained in:
yangdx
2025-02-21 14:46:27 +08:00
parent 1749678384
commit cff229a806
2 changed files with 10 additions and 5 deletions

View File

@@ -263,9 +263,8 @@ class LightRAG:
_storages_status: StoragesStatus = field(default=StoragesStatus.NOT_CREATED)
def __post_init__(self):
logger.setLevel(self.log_level)
os.makedirs(os.path.dirname(self.log_file_path), exist_ok=True)
set_logger(self.log_file_path)
set_logger(self.log_file_path, self.log_level)
logger.info(f"Logger initialized for working directory: {self.working_dir}")
if not os.path.exists(self.working_dir):