From bf6b0f6dcdecb68a85c2917ed83c8a04812e85ad Mon Sep 17 00:00:00 2001 From: vinoyang Date: Thu, 26 Sep 2024 20:55:15 +0800 Subject: [PATCH] Set tos python sdk default log level to warning (#144) --- tosfs/consts.py | 1 + tosfs/core.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tosfs/consts.py b/tosfs/consts.py index 556aac0..0ebf0ac 100644 --- a/tosfs/consts.py +++ b/tosfs/consts.py @@ -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" diff --git a/tosfs/core.py b/tosfs/core.py index 21363b5..477f774 100644 --- a/tosfs/core.py +++ b/tosfs/core.py @@ -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, @@ -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, )