Skip to content

Commit

Permalink
Set tos python sdk default log level to warning (#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
yanghua authored Sep 26, 2024
1 parent 2f54b0c commit bf6b0f6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
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

0 comments on commit bf6b0f6

Please sign in to comment.