@@ -112,8 +112,9 @@ where
112
112
// Need to emit this as a log, because it is not part of a span and will be lost
113
113
// otherwise.
114
114
emit_event_as_log_span ( tracer, event, & tracing:: Span :: current ( ) ) ;
115
- }
116
- if let Some ( writer) = & tracer. console_writer {
115
+ } else if let Some ( writer) = & tracer. console_writer {
116
+ // If it's not being emitted as a top-level log, need to print it to console
117
+ // (if it's emitted, the console processor will handle it)
117
118
writer. write_tracing_event ( event) ;
118
119
}
119
120
} ) ;
@@ -286,7 +287,7 @@ mod tests {
286
287
},
287
288
parent_span_id: 0000000000000000,
288
289
span_kind: Internal,
289
- name: "event src/bridges/tracing.rs:260 ",
290
+ name: "event src/bridges/tracing.rs:261 ",
290
291
start_time: SystemTime {
291
292
tv_sec: 0,
292
293
tv_nsec: 0,
@@ -1458,7 +1459,7 @@ mod tests {
1458
1459
"code.lineno",
1459
1460
),
1460
1461
value: I64(
1461
- 268 ,
1462
+ 269 ,
1462
1463
),
1463
1464
},
1464
1465
],
@@ -1524,7 +1525,7 @@ mod tests {
1524
1525
"code.lineno",
1525
1526
),
1526
1527
value: I64(
1527
- 269 ,
1528
+ 270 ,
1528
1529
),
1529
1530
},
1530
1531
],
@@ -1598,15 +1599,13 @@ mod tests {
1598
1599
1599
1600
assert_snapshot ! ( output, @r#"
1600
1601
[2m1970-01-01T00:00:00.000000Z[0m[32m INFO[0m [2;3mlogfire::bridges::tracing::tests[0m [1mroot event[0m
1601
- [2m1970-01-01T00:00:00.000001Z[0m[32m INFO[0m [2;3mlogfire::bridges::tracing::tests[0m [1mroot event[0m
1602
- [2m1970-01-01T00:00:00.000002Z[0m[32m INFO[0m [2;3mlogfire::bridges::tracing::tests[0m [1mroot event with value[0m [3mfield_value[0m=1
1603
- [2m1970-01-01T00:00:00.000003Z[0m[32m INFO[0m [2;3mlogfire::bridges::tracing::tests[0m [1mroot event with value[0m [3mfield_value[0m=1
1604
- [2m1970-01-01T00:00:00.000004Z[0m[32m INFO[0m [2;3mlogfire::bridges::tracing::tests[0m [1mroot span[0m
1605
- [2m1970-01-01T00:00:00.000005Z[0m[32m INFO[0m [2;3mlogfire::bridges::tracing::tests[0m [1mhello world span[0m
1606
- [2m1970-01-01T00:00:00.000006Z[0m[34m DEBUG[0m [2;3mlogfire::bridges::tracing::tests[0m [1mdebug span[0m
1607
- [2m1970-01-01T00:00:00.000007Z[0m[34m DEBUG[0m [2;3mlogfire::bridges::tracing::tests[0m [1mdebug span with explicit parent[0m
1608
- [2m1970-01-01T00:00:00.000008Z[0m[32m INFO[0m [2;3mlogfire::bridges::tracing::tests[0m [1mhello world log[0m
1609
- [2m1970-01-01T00:00:00.000009Z[0m[32m INFO[0m [2;3mlogfire::bridges::tracing::tests[0m [1mhello world log with value[0m [3mfield_value[0m=1
1602
+ [2m1970-01-01T00:00:00.000001Z[0m[32m INFO[0m [2;3mlogfire::bridges::tracing::tests[0m [1mroot event with value[0m [3mfield_value[0m=1
1603
+ [2m1970-01-01T00:00:00.000002Z[0m[32m INFO[0m [2;3mlogfire::bridges::tracing::tests[0m [1mroot span[0m
1604
+ [2m1970-01-01T00:00:00.000003Z[0m[32m INFO[0m [2;3mlogfire::bridges::tracing::tests[0m [1mhello world span[0m
1605
+ [2m1970-01-01T00:00:00.000004Z[0m[34m DEBUG[0m [2;3mlogfire::bridges::tracing::tests[0m [1mdebug span[0m
1606
+ [2m1970-01-01T00:00:00.000005Z[0m[34m DEBUG[0m [2;3mlogfire::bridges::tracing::tests[0m [1mdebug span with explicit parent[0m
1607
+ [2m1970-01-01T00:00:00.000006Z[0m[32m INFO[0m [2;3mlogfire::bridges::tracing::tests[0m [1mhello world log[0m
1608
+ [2m1970-01-01T00:00:00.000007Z[0m[32m INFO[0m [2;3mlogfire::bridges::tracing::tests[0m [1mhello world log with value[0m [3mfield_value[0m=1
1610
1609
"# ) ;
1611
1610
}
1612
1611
}
0 commit comments