From ece0f1d1118fdf66c85e33e498c9b14ad016a0e4 Mon Sep 17 00:00:00 2001 From: Hasan Ramezani Date: Wed, 29 Jan 2025 18:01:52 +0330 Subject: [PATCH] Add check for the texts that should be printed in console --- logfire/_internal/exporters/console.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/logfire/_internal/exporters/console.py b/logfire/_internal/exporters/console.py index 21d431549..c4b34e228 100644 --- a/logfire/_internal/exporters/console.py +++ b/logfire/_internal/exporters/console.py @@ -117,10 +117,11 @@ def _print_span(self, span: ReadableSpan, indent: int = 0): if details_parts: parts += [('\n', '')] + details_parts + print(parts) if self._console: - self._console.print(Text.assemble(*parts)) + self._console.print(Text.assemble(*[(text, style) for text, style in parts if isinstance(text, str)])) # type: ignore else: - print(''.join(text for text, _style in parts), file=self._output) + print(''.join(text for text, _style in parts if isinstance(text, str)), file=self._output) # type: ignore # This uses a separate system for color vs no-color because it's not simple text: # in the rich case it uses syntax highlighting and columns for layout.