working commit

This commit is contained in:
2026-05-15 15:30:29 +02:00
parent 879481feab
commit 886684e224
28 changed files with 629 additions and 81 deletions
+25
View File
@@ -22,6 +22,7 @@ UxLogger::UxLogger(const std::string 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};
@@ -30,3 +31,27 @@ void UxLogger::Log(const std::string& message) {
std::cout << std::format("{} {} {}\n", timenow, label, message);
}
void UxLogger::Debug(const std::string& message) {
LogLevel("debug", message);
}
void UxLogger::Info(const std::string& message) {
LogLevel("info", message);
}
void UxLogger::Warning(const std::string& message) {
LogLevel("warning", message);
}
void UxLogger::Error(const std::string& message) {
LogLevel("error", message);
}
void UxLogger::LogLevel(const std::string level, 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, level, label, message);
}