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

Set tos python sdk default log level to warning #144

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions tosfs/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@

# environment variable names
ENV_NAME_TOSFS_LOGGING_LEVEL = "TOSFS_LOGGING_LEVEL"
ENV_NAME_TOS_SDK_LOGGING_LEVEL = "TOS_SDK_LOGGING_LEVEL"
ENV_NAME_TOS_BUCKET_TAG_ENABLE = "TOS_BUCKET_TAG_ENABLE"
3 changes: 2 additions & 1 deletion tosfs/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

from tosfs.consts import (
APPEND_OPERATION_SMALL_FILE_THRESHOLD,
ENV_NAME_TOS_SDK_LOGGING_LEVEL,
ENV_NAME_TOSFS_LOGGING_LEVEL,
FILE_OPERATION_READ_WRITE_BUFFER_SIZE,
GET_OBJECT_OPERATION_DEFAULT_READ_CHUNK_SIZE,
Expand Down Expand Up @@ -75,7 +76,7 @@ def setup_logging() -> None:
# set and config tos client's logger
tos.set_logger(
name="tosclient",
level=os.environ.get(ENV_NAME_TOSFS_LOGGING_LEVEL, "INFO"),
level=os.environ.get(ENV_NAME_TOS_SDK_LOGGING_LEVEL, "WARNING"),
log_handler=logging.StreamHandler(),
format_string=TOSFS_LOG_FORMAT,
)
Expand Down