Compare commits

..

4 Commits

Author SHA1 Message Date
Alexey Rybalchenko
d4bdb396bb Add GitHub CI workflow 2025-07-02 13:11:36 +02:00
Alexey Rybalchenko
32f9c0cc00 Add LOGFD and LOGPD macros 2025-07-02 11:50:32 +02:00
Alexey Rybalchenko
3bf9bc8201 Use prefixed macros in case non-prefixed ones are undefined 2025-07-01 11:22:01 +02:00
Alexey Rybalchenko
b61caf5a1e add install/ to git ignore 2025-07-01 11:21:39 +02:00

View File

@@ -15,7 +15,6 @@
#endif
#include <cstdio> // printf
#include <ctime> // std::localtime
#include <iostream>
#include <iterator> // std::back_inserter
@@ -172,11 +171,11 @@ Logger::Logger(Severity severity, Verbosity verbosity, std::string_view file, st
break;
case VSpec::Info::timestamp_us:
FillTimeInfos();
fmt::format_to(std::back_inserter(fBWPrefix), "[{:%H:%M:%S}.{:06}]", *std::localtime(&fInfos.timestamp), fInfos.us.count());
fmt::format_to(std::back_inserter(fBWPrefix), "[{:%H:%M:%S}.{:06}]", fmt::localtime(fInfos.timestamp), fInfos.us.count());
break;
case VSpec::Info::timestamp_s:
FillTimeInfos();
fmt::format_to(std::back_inserter(fBWPrefix), "[{:%H:%M:%S}]", *std::localtime(&fInfos.timestamp));
fmt::format_to(std::back_inserter(fBWPrefix), "[{:%H:%M:%S}]", fmt::localtime(fInfos.timestamp));
break;
case VSpec::Info::severity:
fmt::format_to(std::back_inserter(fBWPrefix), "[{}]", fInfos.severity_name);
@@ -208,11 +207,11 @@ Logger::Logger(Severity severity, Verbosity verbosity, std::string_view file, st
break;
case VSpec::Info::timestamp_us:
FillTimeInfos();
fmt::format_to(std::back_inserter(fColorPrefix), "[{}{:%H:%M:%S}.{:06}{}]", startColor(Color::fgCyan), *std::localtime(&fInfos.timestamp), fInfos.us.count(), endColor());
fmt::format_to(std::back_inserter(fColorPrefix), "[{}{:%H:%M:%S}.{:06}{}]", startColor(Color::fgCyan), fmt::localtime(fInfos.timestamp), fInfos.us.count(), endColor());
break;
case VSpec::Info::timestamp_s:
FillTimeInfos();
fmt::format_to(std::back_inserter(fColorPrefix), "[{}{:%H:%M:%S}{}]", startColor(Color::fgCyan), *std::localtime(&fInfos.timestamp), endColor());
fmt::format_to(std::back_inserter(fColorPrefix), "[{}{:%H:%M:%S}{}]", startColor(Color::fgCyan), fmt::localtime(fInfos.timestamp), endColor());
break;
case VSpec::Info::severity:
fmt::format_to(std::back_inserter(fColorPrefix), "[{}]", GetColoredSeverityString(fInfos.severity));