Skip to content

Commit

Permalink
fix: do not need to register for windows(spawn) (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
yewentao256 authored Jun 14, 2024
1 parent 753f649 commit 7816352
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lazyllm/common/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from sys import stderr
from zipfile import ZipFile
import lazyllm
import platform
from .utils import check_path

from loguru import logger
Expand Down Expand Up @@ -116,7 +117,7 @@ def add_file_sink():
log_file_path = join(log_dir_path, log_file_name)
LOG.add(
log_file_path,
level=lazyllm.config['log_file_level'],
level=lazyllm.config["log_file_level"],
format="{message}",
encoding="utf-8",
rotation=lazyllm.config["log_file_size"],
Expand All @@ -132,6 +133,7 @@ def add_file_sink():

add_file_sink()

os.register_at_fork(
after_in_child=add_file_sink,
)
if platform.system() != "Windows":
os.register_at_fork(
after_in_child=add_file_sink,
)

0 comments on commit 7816352

Please sign in to comment.