Skip to content

Commit 1c21d6e

Browse files
authored
logs: stop sending logfire.msg, test event_name properly (#84)
1 parent cd0b7dc commit 1c21d6e

File tree

5 files changed

+90
-217
lines changed

5 files changed

+90
-217
lines changed

src/bridges/log.rs

Lines changed: 42 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ mod tests {
118118
[
119119
LogDataWithResource {
120120
record: SdkLogRecord {
121-
event_name: None,
121+
event_name: Some(
122+
"log message",
123+
),
122124
target: None,
123125
timestamp: Some(
124126
SystemTime {
@@ -207,28 +209,16 @@ mod tests {
207209
Some(
208210
(
209211
Static(
210-
"logfire.msg",
212+
"thread.id",
211213
),
212-
String(
213-
Owned(
214-
"root event",
215-
),
214+
Int(
215+
0,
216216
),
217217
),
218218
),
219219
],
220220
overflow: Some(
221221
[
222-
Some(
223-
(
224-
Static(
225-
"thread.id",
226-
),
227-
Int(
228-
0,
229-
),
230-
),
231-
),
232222
Some(
233223
(
234224
Static(
@@ -261,7 +251,9 @@ mod tests {
261251
},
262252
LogDataWithResource {
263253
record: SdkLogRecord {
264-
event_name: None,
254+
event_name: Some(
255+
"log message",
256+
),
265257
target: None,
266258
timestamp: Some(
267259
SystemTime {
@@ -350,28 +342,16 @@ mod tests {
350342
Some(
351343
(
352344
Static(
353-
"logfire.msg",
345+
"thread.id",
354346
),
355-
String(
356-
Owned(
357-
"root event with target",
358-
),
347+
Int(
348+
0,
359349
),
360350
),
361351
),
362352
],
363353
overflow: Some(
364354
[
365-
Some(
366-
(
367-
Static(
368-
"thread.id",
369-
),
370-
Int(
371-
0,
372-
),
373-
),
374-
),
375355
Some(
376356
(
377357
Static(
@@ -404,7 +384,9 @@ mod tests {
404384
},
405385
LogDataWithResource {
406386
record: SdkLogRecord {
407-
event_name: None,
387+
event_name: Some(
388+
"log message",
389+
),
408390
target: None,
409391
timestamp: Some(
410392
SystemTime {
@@ -493,28 +475,16 @@ mod tests {
493475
Some(
494476
(
495477
Static(
496-
"logfire.msg",
478+
"thread.id",
497479
),
498-
String(
499-
Owned(
500-
"hello world log",
501-
),
480+
Int(
481+
0,
502482
),
503483
),
504484
),
505485
],
506486
overflow: Some(
507487
[
508-
Some(
509-
(
510-
Static(
511-
"thread.id",
512-
),
513-
Int(
514-
0,
515-
),
516-
),
517-
),
518488
Some(
519489
(
520490
Static(
@@ -547,7 +517,9 @@ mod tests {
547517
},
548518
LogDataWithResource {
549519
record: SdkLogRecord {
550-
event_name: None,
520+
event_name: Some(
521+
"log message",
522+
),
551523
target: None,
552524
timestamp: Some(
553525
SystemTime {
@@ -636,28 +608,16 @@ mod tests {
636608
Some(
637609
(
638610
Static(
639-
"logfire.msg",
611+
"thread.id",
640612
),
641-
String(
642-
Owned(
643-
"warning log",
644-
),
613+
Int(
614+
0,
645615
),
646616
),
647617
),
648618
],
649619
overflow: Some(
650620
[
651-
Some(
652-
(
653-
Static(
654-
"thread.id",
655-
),
656-
Int(
657-
0,
658-
),
659-
),
660-
),
661621
Some(
662622
(
663623
Static(
@@ -690,7 +650,9 @@ mod tests {
690650
},
691651
LogDataWithResource {
692652
record: SdkLogRecord {
693-
event_name: None,
653+
event_name: Some(
654+
"log message",
655+
),
694656
target: None,
695657
timestamp: Some(
696658
SystemTime {
@@ -779,28 +741,16 @@ mod tests {
779741
Some(
780742
(
781743
Static(
782-
"logfire.msg",
744+
"thread.id",
783745
),
784-
String(
785-
Owned(
786-
"error log",
787-
),
746+
Int(
747+
0,
788748
),
789749
),
790750
),
791751
],
792752
overflow: Some(
793753
[
794-
Some(
795-
(
796-
Static(
797-
"thread.id",
798-
),
799-
Int(
800-
0,
801-
),
802-
),
803-
),
804754
Some(
805755
(
806756
Static(
@@ -833,7 +783,9 @@ mod tests {
833783
},
834784
LogDataWithResource {
835785
record: SdkLogRecord {
836-
event_name: None,
786+
event_name: Some(
787+
"log message",
788+
),
837789
target: None,
838790
timestamp: Some(
839791
SystemTime {
@@ -922,28 +874,16 @@ mod tests {
922874
Some(
923875
(
924876
Static(
925-
"logfire.msg",
877+
"thread.id",
926878
),
927-
String(
928-
Owned(
929-
"debug log",
930-
),
879+
Int(
880+
0,
931881
),
932882
),
933883
),
934884
],
935885
overflow: Some(
936886
[
937-
Some(
938-
(
939-
Static(
940-
"thread.id",
941-
),
942-
Int(
943-
0,
944-
),
945-
),
946-
),
947887
Some(
948888
(
949889
Static(
@@ -976,7 +916,9 @@ mod tests {
976916
},
977917
LogDataWithResource {
978918
record: SdkLogRecord {
979-
event_name: None,
919+
event_name: Some(
920+
"log message",
921+
),
980922
target: None,
981923
timestamp: Some(
982924
SystemTime {
@@ -1065,28 +1007,16 @@ mod tests {
10651007
Some(
10661008
(
10671009
Static(
1068-
"logfire.msg",
1010+
"thread.id",
10691011
),
1070-
String(
1071-
Owned(
1072-
"trace log",
1073-
),
1012+
Int(
1013+
0,
10741014
),
10751015
),
10761016
),
10771017
],
10781018
overflow: Some(
10791019
[
1080-
Some(
1081-
(
1082-
Static(
1083-
"thread.id",
1084-
),
1085-
Int(
1086-
0,
1087-
),
1088-
),
1089-
),
10901020
Some(
10911021
(
10921022
Static(

0 commit comments

Comments
 (0)