Skip to content

Why is sagemaker-core setting the log_level of the root logger to INFO? #286

@abdulfatir

Description

@abdulfatir

Describe the bug

sagemaker_core calls

enable_textual_rich_console_and_traceback()

which also sets the LOG_LEVEL for the root logger to INFO! See here:

logging.basicConfig(level=getattr(logging, log_level), handlers=[handler])

This is undesirable behavior and definitely not something that should be part of "core". Also, I am not sure if there's a way to even configure this.

To reproduce

import logging
from importlib.metadata import version


root_logger = logging.getLogger()

print("Log Level (Before)", root_logger.level)

import sagemaker_core

print("Log Level (After)", root_logger.level)
print(version("sagemaker_core"))

Expected behavior
The log level of the root logger should NOT be changed.

Unrelated, but sagemaker_core also does not provide .__version__ for easy version access.

Screenshots or logs
Output from the MWE above:

Log Level (Before) 30
Log Level (After) 20
1.0.29

Bug information
A description of your system. Please provide:

  • SageMaker Core version: 1.0.29
  • Python version: 3.11
  • Is the issue with autogen code or with generate code ?:

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions