Commit ddd916e
committed
Use nanosecond precision for LogEvent comparison
Compare LogEvent instances using getInstant().getNanoOfMillisecond() instead of getTimeMillis() by adding a helper method. Add a unit test (testAppendTransferAndStopClearsEvents) to verify InMemoryAppender.transfer() behavior, that events are not duplicated and stop() clears buffered events. Also import SimpleMessage and update test event creation to use the imported type.1 parent a22397e commit ddd916e
2 files changed
Lines changed: 35 additions & 2 deletions
File tree
- microsphere-log4j2/src
- main/java/io/microsphere/logging/log4j2
- test/java/io/microsphere/logging/log4j2/appender
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
43 | 47 | | |
44 | 48 | | |
Lines changed: 30 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
64 | 93 | | |
65 | 94 | | |
66 | 95 | | |
| |||
75 | 104 | | |
76 | 105 | | |
77 | 106 | | |
78 | | - | |
| 107 | + | |
79 | 108 | | |
80 | 109 | | |
81 | 110 | | |
| |||
0 commit comments