MCPcopy
hub / github.com/crewAIInc/crewAI / print

Method print

lib/crewai-core/src/crewai_core/printer.py:78–100  ·  view source on GitHub ↗

Print ``content`` with optional color, honoring suppression context.

(
        content: str | list[ColoredText],
        color: PrinterColor | None = None,
        sep: str | None = " ",
        end: str | None = "\n",
        file: SupportsWrite[str] | None = None,
        flush: Literal[False] = False,
    )

Source from the content-addressed store, hash-verified

76
77 @staticmethod
78 def print(
79 content: str | list[ColoredText],
80 color: PrinterColor | None = None,
81 sep: str | None = " ",
82 end: str | None = "\n",
83 file: SupportsWrite[str] | None = None,
84 flush: Literal[False] = False,
85 ) -> None:
86 """Print ``content`` with optional color, honoring suppression context."""
87 if should_suppress_console_output():
88 return
89 if isinstance(content, str):
90 content = [ColoredText(content, color)]
91 print(
92 "".join(
93 f"{_COLOR_CODES[c.color] if c.color else ''}{c.text}{RESET}"
94 for c in content
95 ),
96 sep=sep,
97 end=end,
98 file=file,
99 flush=flush,
100 )
101
102
103PRINTER: Printer = Printer()

Callers 15

_chain_deployFunction · 0.45
_print_post_tui_summaryFunction · 0.45
add_crew_to_flowFunction · 0.45
env_viewFunction · 0.45
traces_enableFunction · 0.45
traces_disableFunction · 0.45
traces_statusFunction · 0.45
fetch_and_json_env_fileFunction · 0.45
__init__Method · 0.45
_validate_responseMethod · 0.45
_show_interpolation_hintFunction · 0.45

Calls 3

ColoredTextClass · 0.85
joinMethod · 0.80