diff --git a/docs/guides/reporting/text_reporting.md b/docs/guides/reporting/text_reporting.md index 1b7eba72..0f99b532 100644 --- a/docs/guides/reporting/text_reporting.md +++ b/docs/guides/reporting/text_reporting.md @@ -3,15 +3,46 @@ title: Text Reporting --- The [text_reporting.py](https://github.com/clearml/clearml/blob/master/examples/reporting/text_reporting.py) script -demonstrates reporting explicit text by calling [`Logger.report_text()`](../../references/sdk/logger.md#report_text). - -ClearML reports the text in the **ClearML Web UI**, in the task's **CONSOLE** tab. +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()`](../../references/sdk/logger.md#report_text) + ```python # report text Logger.current_logger().report_text("hello, this is plain text") ``` -![image](../../img/examples_reporting_text.png) \ No newline at end of file +Text reported with `Logger.report_text()` appears in the task's **CONSOLE** tab in the ClearML Web UI. + +![Text to console](../../img/examples_reporting_text.png#light-mode-only) +![Text to console](../../img/examples_reporting_text_dark.png#dark-mode-only) + +## 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()`](../../references/sdk/logger.md#report_media) with a text stream and `.txt` file extension. + +```python +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](../../img/examples_reporting_text_debug.png#light-mode-only) +![Text debug sample](../../img/examples_reporting_text_debug_dark.png#dark-mode-only) diff --git a/docs/img/examples_reporting_text.png b/docs/img/examples_reporting_text.png index 1328f2b4..9c9cde98 100644 Binary files a/docs/img/examples_reporting_text.png and b/docs/img/examples_reporting_text.png differ diff --git a/docs/img/examples_reporting_text_dark.png b/docs/img/examples_reporting_text_dark.png new file mode 100644 index 00000000..12cbbf2a Binary files /dev/null and b/docs/img/examples_reporting_text_dark.png differ diff --git a/docs/img/examples_reporting_text_debug.png b/docs/img/examples_reporting_text_debug.png new file mode 100644 index 00000000..341f8238 Binary files /dev/null and b/docs/img/examples_reporting_text_debug.png differ diff --git a/docs/img/examples_reporting_text_debug_dark.png b/docs/img/examples_reporting_text_debug_dark.png new file mode 100644 index 00000000..be0c3742 Binary files /dev/null and b/docs/img/examples_reporting_text_debug_dark.png differ