Skip to content

Commit

Permalink
Fixed the bug caused by the given path not existing in the logging s…
Browse files Browse the repository at this point in the history
…ystem. (#25)
  • Loading branch information
yewentao256 authored Jun 21, 2024
1 parent d7ac613 commit 727085c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lazyllm/common/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class _Log:
def __init__(self):
self._name = lazyllm.config["log_name"]
self._pid = getpid()
self._log_dir_path = check_path(lazyllm.config["log_dir"], exist=False, file=False)

if getenv("LOGURU_AUTOINIT", "true").lower() in ("1", "true") and stderr:
try:
Expand Down Expand Up @@ -101,9 +102,8 @@ def __getattr__(self, attr):
def add_file_sink():
name = lazyllm.config["log_name"]
pid = getpid()
log_dir_path = lazyllm.config["log_dir"]
log_dir_path = LOG._log_dir_path
if log_dir_path:
log_dir_path = check_path(log_dir_path, exist=False, file=False)
log_file_mode = lazyllm.config["log_file_mode"]
if log_file_mode == "merge":
log_file_name = f"{name}.json.log"
Expand Down

0 comments on commit 727085c

Please sign in to comment.