Add timestamps to logs
This commit is contained in:
parent
1ad58d0096
commit
8a30b59dfd
@ -77,8 +77,11 @@ void Log::Init()
|
|||||||
|
|
||||||
auto format = [is_terminal](const char *level, const char *color) {
|
auto format = [is_terminal](const char *level, const char *color) {
|
||||||
const auto timestamp = std::chrono::system_clock::now();
|
const auto timestamp = std::chrono::system_clock::now();
|
||||||
return fmt::format(
|
return fmt::format("{}[{:%FT%H:%M:}{:%S}] [{}] ",
|
||||||
"{}[{:%FT%H:%M:}{:%S}] [{}] ", is_terminal ? color : "", timestamp, timestamp.time_since_epoch(), level);
|
is_terminal ? color : "",
|
||||||
|
timestamp,
|
||||||
|
timestamp.time_since_epoch(),
|
||||||
|
level);
|
||||||
};
|
};
|
||||||
|
|
||||||
switch (level)
|
switch (level)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user