From 371e5692d88619d1842457d576ff3d8530eef076 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/logfire/_internal/exporters/console.py b/logfire/_internal/exporters/console.py index 21d431549..c421bc8b4 100644 --- a/logfire/_internal/exporters/console.py +++ b/logfire/_internal/exporters/console.py @@ -118,9 +118,9 @@ def _print_span(self, span: ReadableSpan, indent: int = 0): parts += [('\n', '')] + details_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.