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

Consolidate to one logger #149

Merged
merged 1 commit into from
Mar 13, 2025
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
7 changes: 3 additions & 4 deletions src/agents/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,9 @@ def set_default_openai_api(api: Literal["chat_completions", "responses"]) -> Non

def enable_verbose_stdout_logging():
"""Enables verbose logging to stdout. This is useful for debugging."""
for name in ["openai.agents", "openai.agents.tracing"]:
logger = logging.getLogger(name)
logger.setLevel(logging.DEBUG)
logger.addHandler(logging.StreamHandler(sys.stdout))
logger = logging.getLogger("openai.agents")
logger.setLevel(logging.DEBUG)
logger.addHandler(logging.StreamHandler(sys.stdout))


__all__ = [
Expand Down
2 changes: 1 addition & 1 deletion src/agents/tracing/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from collections.abc import Mapping, Sequence
from typing import TYPE_CHECKING, Any

from .logger import logger
from ..logger import logger
from .setup import GLOBAL_TRACE_PROVIDER
from .span_data import (
AgentSpanData,
Expand Down
2 changes: 1 addition & 1 deletion src/agents/tracing/processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import httpx

from .logger import logger
from ..logger import logger
from .processor_interface import TracingExporter, TracingProcessor
from .spans import Span
from .traces import Trace
Expand Down
2 changes: 1 addition & 1 deletion src/agents/tracing/scope.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import contextvars
from typing import TYPE_CHECKING, Any

from .logger import logger
from ..logger import logger

if TYPE_CHECKING:
from .spans import Span
Expand Down
2 changes: 1 addition & 1 deletion src/agents/tracing/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import threading
from typing import Any

from ..logger import logger
from . import util
from .logger import logger
from .processor_interface import TracingProcessor
from .scope import Scope
from .spans import NoOpSpan, Span, SpanImpl, TSpanData
Expand Down
2 changes: 1 addition & 1 deletion src/agents/tracing/spans.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

from typing_extensions import TypedDict

from ..logger import logger
from . import util
from .logger import logger
from .processor_interface import TracingProcessor
from .scope import Scope
from .span_data import SpanData
Expand Down
2 changes: 1 addition & 1 deletion src/agents/tracing/traces.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import contextvars
from typing import Any

from ..logger import logger
from . import util
from .logger import logger
from .processor_interface import TracingProcessor
from .scope import Scope

Expand Down