Open Lighting Architecture
0.10.4
|
The OLA logging system.
Files | |
file | Logging.cpp |
file | Logging.h |
Header file for OLA Logging. | |
Namespaces | |
ola | |
The namespace containing all OLA symbols. | |
Classes | |
class | ola::LogDestination |
The base class for log destinations. More... | |
class | ola::StdErrorLogDestination |
A LogDestination that writes to stderr. More... | |
class | ola::SyslogDestination |
An abstract base of LogDestination that writes to syslog. More... | |
class | ola::UnixSyslogDestination |
A SyslogDestination that writes to Unix syslog. More... | |
Macros | |
#define | OLA_LOG(level) |
#define | OLA_FATAL OLA_LOG(ola::OLA_LOG_FATAL) |
#define | OLA_WARN OLA_LOG(ola::OLA_LOG_WARN) |
#define | OLA_INFO OLA_LOG(ola::OLA_LOG_INFO) |
#define | OLA_DEBUG OLA_LOG(ola::OLA_LOG_DEBUG) |
Enumerations | |
enum | ola::log_level { ola::OLA_LOG_NONE, ola::OLA_LOG_FATAL, ola::OLA_LOG_WARN, ola::OLA_LOG_INFO, ola::OLA_LOG_DEBUG, OLA_LOG_MAX } |
The OLA log levels. This controls the verbosity of logging. Each level also includes those below it. More... | |
enum | ola::log_output { ola::OLA_LOG_STDERR, ola::OLA_LOG_SYSLOG, OLA_LOG_NULL } |
The destination to write log messages to. More... | |
Functions | |
void | ola::SetLogLevel (log_level level) |
Set the logging level. More... | |
void | ola::IncrementLogLevel () |
Increment the log level by one. The log level wraps to OLA_LOG_NONE. | |
bool | ola::InitLoggingFromFlags () |
Initialize the OLA logging system from flags. More... | |
bool | ola::InitLogging (log_level level, log_output output) |
Initialize the OLA logging system. More... | |
void | ola::InitLogging (log_level level, LogDestination *destination) |
Initialize the OLA logging system using the specified LogDestination. More... | |
virtual | ola::LogDestination::~LogDestination () |
Destructor. | |
virtual void | ola::LogDestination::Write (log_level level, const std::string &log_line)=0 |
An abstract function for writing to your log destination. More... | |
void | ola::StdErrorLogDestination::Write (log_level level, const std::string &log_line) |
Writes a messages out to stderr. | |
virtual | ola::SyslogDestination::~SyslogDestination () |
Destructor. | |
virtual bool | ola::SyslogDestination::Init ()=0 |
Initialize the SyslogDestination. | |
virtual void | ola::SyslogDestination::Write (log_level level, const std::string &log_line)=0 |
Write a line to the system logger. More... | |
bool | ola::UnixSyslogDestination::Init () |
Initialize the UnixSyslogDestination. | |
void | ola::UnixSyslogDestination::Write (log_level level, const std::string &log_line) |
Write a line to syslog. | |
log_level | ola::LogLevel () |
Fetch the current level of logging. More... | |
#define OLA_DEBUG OLA_LOG(ola::OLA_LOG_DEBUG) |
#define OLA_FATAL OLA_LOG(ola::OLA_LOG_FATAL) |
#define OLA_INFO OLA_LOG(ola::OLA_LOG_INFO) |
#define OLA_LOG | ( | level | ) |
Provide a stream interface to log a message at the specified log level. Rather than calling this directly use one of the OLA_FATAL, OLA_WARN, OLA_INFO or OLA_DEBUG macros.
level | the log_level to log at. |
#define OLA_WARN OLA_LOG(ola::OLA_LOG_WARN) |
enum ola::log_level |
The OLA log levels. This controls the verbosity of logging. Each level also includes those below it.
enum ola::log_output |
bool ola::InitLogging | ( | log_level | level, |
log_output | output | ||
) |
Initialize the OLA logging system.
level | the level to log at |
output | the destination for the logs |
void ola::InitLogging | ( | log_level | level, |
LogDestination * | destination | ||
) |
Initialize the OLA logging system using the specified LogDestination.
level | the level to log at |
destination | the LogDestination to use. |
bool ola::InitLoggingFromFlags | ( | ) |
Initialize the OLA logging system from flags.
|
inline |
Fetch the current level of logging.
void ola::SetLogLevel | ( | log_level | level | ) |
Set the logging level.
level | the new log_level to use. |
|
pure virtual |
An abstract function for writing to your log destination.
Implemented in ola::UnixSyslogDestination, ola::SyslogDestination, and ola::StdErrorLogDestination.
|
pure virtual |
Write a line to the system logger.
Implements ola::LogDestination.
Implemented in ola::UnixSyslogDestination.