Home / Function/ setup_logging() — anthropic-sdk-python Function Reference

setup_logging() — anthropic-sdk-python Function Reference

Architecture documentation for the setup_logging() function in _logs.py from the anthropic-sdk-python codebase.

Entity Profile

Dependency Diagram

graph TD
  0f3f2a0b_b8c5_1f24_75d4_8ef73382e9ca["setup_logging()"]
  9ee341c1_cb2e_bfd0_6bd3_0e4d237fbb62["_logs.py"]
  0f3f2a0b_b8c5_1f24_75d4_8ef73382e9ca -->|defined in| 9ee341c1_cb2e_bfd0_6bd3_0e4d237fbb62
  079f7985_d5e6_3331_891b_707d18fd6720["_basic_config()"]
  0f3f2a0b_b8c5_1f24_75d4_8ef73382e9ca -->|calls| 079f7985_d5e6_3331_891b_707d18fd6720
  style 0f3f2a0b_b8c5_1f24_75d4_8ef73382e9ca fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/anthropic/_utils/_logs.py lines 16–25

def setup_logging() -> None:
    env = os.environ.get("ANTHROPIC_LOG")
    if env == "debug":
        _basic_config()
        logger.setLevel(logging.DEBUG)
        httpx_logger.setLevel(logging.DEBUG)
    elif env == "info":
        _basic_config()
        logger.setLevel(logging.INFO)
        httpx_logger.setLevel(logging.INFO)

Subdomains

Frequently Asked Questions

What does setup_logging() do?
setup_logging() is a function in the anthropic-sdk-python codebase, defined in src/anthropic/_utils/_logs.py.
Where is setup_logging() defined?
setup_logging() is defined in src/anthropic/_utils/_logs.py at line 16.
What does setup_logging() call?
setup_logging() calls 1 function(s): _basic_config.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free