21 #ifndef LIB_LIGHTMETRICA_LOGGER_H
22 #define LIB_LIGHTMETRICA_LOGGER_H
28 #include <boost/signals2.hpp>
54 NoFileOutput = Signal | Stdout | Stderr | DebugOutput,
55 FileOutput = File | FileHtml,
96 LM_DISABLE_COPY_AND_MOVE(
Logger);
106 static boost::signals2::connection Connect_LogUpdate(
const std::function<
void (
LogEntry*)>& func);
125 static void Error(
const std::string& message,
const std::string& prefix);
132 static void Warn(
const std::string& message,
const std::string& prefix);
139 static void Info(
const std::string& message,
const std::string& prefix);
146 static void Debug(
const std::string& message,
const std::string& prefix);
152 static int CountNoFileOutputEntries();
158 static int CountFileOutputEntries();
172 static void SetOutputMode(
int mode);
180 static void SetOutputFrequency(
int freq);
188 static void SetOutputFrequencyForFileOutput(
int freq);
196 static void SetOutputFileName(
const std::string& fileName);
204 static std::string FormattedDebugInfo(
const char* fileName,
int line);
211 static void ProcessOutput();
224 static unsigned int Indentation();
230 static void SetIndentation(
unsigned int indentation);
284 #define LM_LOG_ERROR(message) lightmetrica::Logger::Error(message, lightmetrica::Logger::FormattedDebugInfo(__FILE__, __LINE__));
285 #define LM_LOG_WARN(message) lightmetrica::Logger::Warn(message, lightmetrica::Logger::FormattedDebugInfo(__FILE__, __LINE__));
286 #define LM_LOG_INFO(message) lightmetrica::Logger::Info(message, lightmetrica::Logger::FormattedDebugInfo(__FILE__, __LINE__));
287 #define LM_LOG_DEBUG(message) lightmetrica::Logger::Debug(message, lightmetrica::Logger::FormattedDebugInfo(__FILE__, __LINE__));
289 #define LM_LOG_ERROR(message) lightmetrica::Logger::Error(message, "");
290 #define LM_LOG_WARN(message) lightmetrica::Logger::Warn(message, "");
291 #define LM_LOG_INFO(message) lightmetrica::Logger::Info(message, "");
292 #define LM_LOG_DEBUG(message) lightmetrica::Logger::Debug(message, "");
294 #define LM_LOG_INDENTER() lightmetrica::LogIndenter _logIndenter;
296 #endif // LIB_LIGHTMETRICA_LOGGER_H
LogUpdateMode
Definition: logger.h:62
std::string time
Current time.
Definition: logger.h:87
LogLevel
Definition: logger.h:72
LogOutputMode
Definition: logger.h:45
LogLevel level
Associated log level.
Definition: logger.h:86
std::string message
Log message.
Definition: logger.h:88
static void SetIndentation(unsigned int indentation)
Definition: logger.cpp:479
static unsigned int Indentation()
Definition: logger.cpp:473