mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-07 11:29:56 -04:00
fix(logger): logging timestamps should show local time
This commit is contained in:
parent
7b0b1cdc0c
commit
be8a152a98
@ -393,8 +393,9 @@ std::string get_logger_context(source_location loc) {
|
|||||||
|
|
||||||
std::string get_current_time_string() {
|
std::string get_current_time_string() {
|
||||||
using namespace std::chrono;
|
using namespace std::chrono;
|
||||||
auto now = floor<microseconds>(system_clock::now());
|
auto const now = floor<microseconds>(system_clock::now());
|
||||||
return fmt::format("{:%H:%M:%S}", now);
|
auto const local = safe_localtime(system_clock::to_time_t(now));
|
||||||
|
return fmt::format("{:%H:%M}:{:%S}", local, now);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace dwarfs
|
} // namespace dwarfs
|
||||||
|
Loading…
x
Reference in New Issue
Block a user