44 #ifndef INCLUDE_OLA_LOGGING_H_
45 #define INCLUDE_OLA_LOGGING_H_
57 #define OLA_LOG(level) (level <= ola::LogLevel()) && \
58 ola::LogLine(__FILE__, __LINE__, level).stream()
65 #define OLA_FATAL OLA_LOG(ola::OLA_LOG_FATAL)
73 #define OLA_WARN OLA_LOG(ola::OLA_LOG_WARN)
81 #define OLA_INFO OLA_LOG(ola::OLA_LOG_INFO)
89 #define OLA_DEBUG OLA_LOG(ola::OLA_LOG_DEBUG)
138 virtual void Write(
log_level level,
const std::string &log_line) = 0;
165 virtual bool Init() = 0;
171 virtual void Write(
log_level level,
const std::string &log_line) = 0;
178 class WindowsSyslogDestination :
public SyslogDestination {
188 void Write(
log_level level,
const std::string &log_line);
190 typedef void* WindowsLogHandle;
191 WindowsLogHandle m_eventlog;
220 LogLine(
const char *file,
int line,
log_level level);
224 std::ostream &stream() {
return m_stream; }
227 std::ostringstream m_stream;
228 unsigned int m_prefix_length;
278 #endif // INCLUDE_OLA_LOGGING_H_