44 #ifndef INCLUDE_OLA_LOGGING_H_ 45 #define INCLUDE_OLA_LOGGING_H_ 59 #define OLA_LOG(level) (level <= ola::LogLevel()) && \ 60 ola::LogLine(__FILE__, __LINE__, level).stream() 67 #define OLA_FATAL OLA_LOG(ola::OLA_LOG_FATAL) 75 #define OLA_WARN OLA_LOG(ola::OLA_LOG_WARN) 83 #define OLA_INFO OLA_LOG(ola::OLA_LOG_INFO) 91 #define OLA_DEBUG OLA_LOG(ola::OLA_LOG_DEBUG) 140 virtual void Write(
log_level level,
const std::string &log_line) = 0;
167 virtual bool Init() = 0;
173 virtual void Write(
log_level level,
const std::string &log_line) = 0;
192 typedef void* WindowsLogHandle;
193 WindowsLogHandle m_eventlog;
222 LogLine(
const char *file,
int line,
log_level level);
226 std::ostream &stream() {
return m_stream; }
229 std::ostringstream m_stream;
230 unsigned int m_prefix_length;
280 #endif // INCLUDE_OLA_LOGGING_H_ log_level
The OLA log levels. This controls the verbosity of logging. Each level also includes those below it...
Definition: Logging.h:100
void SetLogLevel(log_level level)
Set the logging level.
Definition: Logging.cpp:71
Definition: Logging.h:102
Definition: Logging.h:103
log_level LogLevel()
Fetch the current level of logging.
Definition: Logging.h:249
void IncrementLogLevel()
Increment the log level by one. The log level wraps to OLA_LOG_NONE.
Definition: Logging.cpp:76
A SyslogDestination that writes to Unix syslog.
Definition: Logging.h:199
log_output
The destination to write log messages to.
Definition: Logging.h:118
An abstract base of LogDestination that writes to syslog.
Definition: Logging.h:157
Definition: Logging.h:101
Definition: Logging.h:104
virtual void Write(log_level level, const std::string &log_line)=0
An abstract function for writing to your log destination.
virtual ~SyslogDestination()
Destructor.
Definition: Logging.h:162
virtual ~LogDestination()
Destructor.
Definition: Logging.h:133
Definition: Logging.h:105
Definition: Logging.h:120
bool InitLogging(log_level level, log_output output)
Initialize the OLA logging system.
Definition: Logging.cpp:118
A LogDestination that writes to stderr.
Definition: Logging.h:146
The namespace containing all OLA symbols.
Definition: Credentials.cpp:44
bool InitLoggingFromFlags()
Initialize the OLA logging system from flags.
Definition: Logging.cpp:83
The base class for log destinations.
Definition: Logging.h:128
Definition: Logging.h:119