clearml-docs/docs/guides/reporting/text_reporting.md
2025-04-27 13:15:36 +03:00

1.6 KiB

title
Text Reporting

The text_reporting.py script demonstrates reporting text output and samples.

When the script runs, it creates a task named text reporting in the examples project.

Reporting Text to Console

To report text to the task console, call Logger.report_text():

# report text
Logger.current_logger().report_text("hello, this is plain text")

Text reported with Logger.report_text() appears in the task's CONSOLE tab in the ClearML Web UI.

Text to console Text to console

Reporting Text as Debug Samples

To report longer text as a debug sample (e.g., logs, large text outputs, or structured text files), use Logger.report_media() with a text stream and .txt file extension:

text_to_send = """
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Suspendisse ac justo ut dolor scelerisque posuere.
...
"""

Logger.current_logger().report_media(
    title="text title",
    series="text series",
    iteration=1,
    stream=six.StringIO(text_to_send),
    file_extension=".txt",
)

Text samples appear in the task's DEBUG SAMPLES tab in the ClearML Web UI.

Text debug sample Text debug sample