improved consistency in argument handling, introduction of dpm_con (not everything needs to be in the log)

This commit is contained in:
Chris Punches
2025-03-26 01:10:18 -04:00
parent b8ee0f9eff
commit 1d34a62e38
12 changed files with 288 additions and 174 deletions

View File

@@ -156,4 +156,24 @@ void Logger::log(LoggingLevels message_level, const std::string& message)
}
}
}
}
void Logger::log_console(LoggingLevels level, const std::string& message)
{
// Only process if the message level is less than or equal to the configured level
if (level <= log_level) {
// Convert log level to string
std::string level_str = LogLevelToString(level);
// Console output without timestamp
if (level == LoggingLevels::FATAL ||
level == LoggingLevels::ERROR ||
level == LoggingLevels::WARN) {
// Send to stderr
std::cerr << level_str << ": " << message << std::endl;
} else {
// Send to stdout
std::cout << message << std::endl;
}
}
}