working commit

This commit is contained in:
Олег Бородин
2026-05-19 16:58:44 +02:00
parent 99b4f4586e
commit 4bed66d2bb
6 changed files with 29 additions and 45 deletions
+2 -16
View File
@@ -15,21 +15,7 @@ UxLogger uxlogger;
static std::mutex mtx;
UxLogger::UxLogger(const std::string ilabel) {
label = ilabel;
}
UxLogger::UxLogger(void) {
label = "global";
}
void UxLogger::Log(const std::string& message) {
auto now = std::chrono::system_clock::now();
std::chrono::zoned_time localnow{std::chrono::current_zone(), now};
std::string timenow = std::format("{:%Y-%m-%dT%H:%M:%OS%Z}", localnow);
std::lock_guard<std::mutex> lock(mtx);
std::cout << std::format("{} {} {}\n", timenow, label, message);
}
UxLogger::UxLogger(void) {}
void UxLogger::Debug(const std::string& message) {
LogLevel("debug", message);
@@ -52,6 +38,6 @@ void UxLogger::LogLevel(const std::string level, const std::string& message) {
std::chrono::zoned_time localnow{std::chrono::current_zone(), now};
std::string timenow = std::format("{:%Y-%m-%dT%H:%M:%OS%Z}", localnow);
std::lock_guard<std::mutex> lock(mtx);
std::cout << std::format("{} {} {} {}\n", timenow, level, label, message);
std::cout << std::format("{} [{}] {}\n", timenow, level, message);
}