Commit 1df6987
authored
Fix incorrect microsecond extraction in logging timestamps (#844)
This PR fixes an issue in the logging module where the microsecond
part of the timestamp was calculated incorrectly.
Previously, the code used:
auto its_ms = (when_.time_since_epoch().count() / 100) % 1000000;
However, this approach incorrectly scaled the raw duration count.
The correct division factor should have been 1000 (not100),
or better yet, the calculation can be performed in a type-safe manner
using std::chrono::duration_cast.
The updated code now correctly extracts the microsecond portion by
converting the duration to microseconds.1 parent e043515 commit 1df6987
2 files changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| |||
0 commit comments