We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 51c1dee commit be10babCopy full SHA for be10bab
1 file changed
src/Span/Exporter/Stdout.php
@@ -5,7 +5,9 @@
5
use Utopia\Span\Span;
6
7
/**
8
- * Exports spans to stdout as JSON
+ * Exports spans as newline-delimited JSON (NDJSON)
9
+ *
10
+ * Spans with errors are written to stderr, all others to stdout.
11
*/
12
class Stdout implements Exporter
13
{
@@ -17,6 +19,8 @@ public function export(Span $span): void
17
19
return;
18
20
}
21
- fwrite(STDOUT, $output . PHP_EOL);
22
+ $stream = $span->get('error.type') !== null ? STDERR : STDOUT;
23
+
24
+ fwrite($stream, $output . PHP_EOL);
25
26
0 commit comments