Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: do not need to register for windows(spawn) #10

Merged
merged 1 commit into from
Jun 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
)