Skip to content

[Bug]: print() in docstring examples in host/ modules should use logger #7153

@Arrnnnaav

Description

@Arrnnnaav

Description

Two files in core/framework/host/ use print() in their docstring
Usage/Example sections, inconsistent with the framework's logging conventions.

Location

  • core/framework/host/agent_host.py line 119 — Usage example uses print()
  • core/framework/host/event_bus.py line 242 — Example block uses print()

Expected Behavior

Docstring examples should model correct logging patterns using logger.info(),
consistent with the fix applied in #4783 and #7152.

Proposed Fix

Replace print() with logger.info() in both docstring examples and add
import logging + logger = logging.getLogger(__name__) so examples are
copy-paste ready.

Why This Matters

Docstring examples are reference implementations for developers. Using print()
teaches bad habits and is inconsistent with the rest of the framework.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions