29 auto now = std::chrono::system_clock::now();
30 auto time = std::chrono::system_clock::to_time_t(now);
33 localtime_s(&tm, &time);
35 localtime_r(&time, &tm);
38 std::strftime(buf,
sizeof(buf),
"%H:%M:%S", &tm);
48 int emLevel = EM_LOG_CONSOLE;
51 emLevel = EM_LOG_CONSOLE;
54 emLevel = EM_LOG_CONSOLE;
57 emLevel = EM_LOG_WARN;
60 emLevel = EM_LOG_ERROR;
Structured logging system.
const char * levelToString(asw::log::Level level)
asw::log::Level currentLevel
std::string getTimestamp()
void logMessage(asw::log::Level level, const std::string &message)
void info(const std::string &message)
Log an info message.
void debug(const std::string &message)
Log a debug message.
void setLevel(Level level)
Set the minimum log level (messages below this are ignored).
void error(const std::string &message)
Log an error message.
void warn(const std::string &message)
Log a warning message.
void setOutput(std::ostream &stream)
Set the output stream (default: std::cerr).
Level
Log severity levels.