-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
bugSomething isn't workingSomething isn't working
Description
The variable timeStr seems to be empty under Windows 11 builds, causing the output to be in nanoseconds only, which completely breaks sorting the log file output.
I'm told that %F and %T were Linux specific extensions. Reverting back to %Y-%m-%d %H:%M:%S (or upgrading to C++20 and using std::format) should provide a cross-platform solution.
Lines 94 to 107 in 981bcd0
| // Format the time as human readable. | |
| // "%F %T" --> "%Y-%m-%d %H:%M:%S" --> "TZONE 2019-08-23 13:42:58\0" (26 chars) | |
| char timeStr[26] = {0}; | |
| std::time_t curTimeSecondPrecision = curTimeNanosecondPrecision/1000000000; // Deliberate integer rounding. | |
| std::strftime(timeStr, sizeof(timeStr), "%Z %F %T", std::localtime(&curTimeSecondPrecision)); | |
| // Finally, print the time stamp. | |
| _buffer << '[' | |
| << timeStr | |
| << ':' | |
| << std::setw(9) << std::right << std::setfill('0') | |
| << (curTimeNanosecondPrecision - curTimeSecondPrecision*1000000000) | |
| << ']'; | |
| _buffer << ' '; |
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working