File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -431,6 +431,7 @@ pub fn (mut h TextHandler) handle(rec Record) ! {
431431 }
432432 }
433433 }
434+
434435 if i + 1 != rec.fields.len {
435436 if i in [0 , 1 ] {
436437 buf.write_byte (` ` )
Original file line number Diff line number Diff line change 1+ import structlog
2+
3+ struct Simple {
4+ foo int
5+ bar string
6+ }
7+
8+ fn test_struct_adapter () {
9+ assert structlog.struct_adapter (Simple{10 , 'fooo' }) == [
10+ structlog.Field{'foo' , 10 },
11+ structlog.Field{'bar' , 'fooo' },
12+ ]
13+ }
14+
15+ /* FIXME
16+ enum SomeEnum {
17+ one
18+ two
19+ three
20+ }
21+
22+ struct WithEnum {
23+ foo int
24+ bar string
25+ some_enum SomeEnum
26+ }
27+
28+ fn test_struct_adapter_with_enum() {
29+ assert structlog.struct_adapter(WithEnum{10, 'fooo', .two}) == [
30+ structlog.Field{'foo', 10},
31+ structlog.Field{'bar', 'fooo'},
32+ structlog.Field{'some_enum', 'two'},
33+ ]
34+ }
35+ */
You can’t perform that action at this time.
0 commit comments