Phoenix
Object-oriented orthogonally persistent operating system
|
Global system log. More...
#include <log.h>
Public Types | |
enum | Level { LOG_ALERT, LOG_CRITICAL, LOG_ERROR, LOG_WARNING, LOG_NOTICE, LOG_INFO, LOG_DEBUG } |
Importance levels for system log messages. More... | |
Public Member Functions | |
virtual SysLogBase & | operator<< (log::SysLogBase::Level level)=0 |
This operator must be overloaded in back-end derived class. | |
template<typename... Args> | |
SysLogBase & | Format (const char *fmt, Args...args) |
Output formated string. | |
SysLogBase & | Format (const char *fmt) |
This method handles edge case of previous template when only format string is specified. | |
SysLogBase & | FormatV (const char *fmt, va_list args) |
Output formatted string. | |
template<typename... Args> | |
SysLogBase & | Alert (const char *fmt, Args...args) |
Output log message with LOG_ALERT level. | |
template<typename... Args> | |
SysLogBase & | Critical (const char *fmt, Args...args) |
Output log message with LOG_CRITICAL level. | |
template<typename... Args> | |
SysLogBase & | Error (const char *fmt, Args...args) |
Output log message with LOG_ERROR level. | |
template<typename... Args> | |
SysLogBase & | Warning (const char *fmt, Args...args) |
Output log message with LOG_WARNING level. | |
template<typename... Args> | |
SysLogBase & | Notice (const char *fmt, Args...args) |
Output log message with LOG_NOTICE level. | |
template<typename... Args> | |
SysLogBase & | Info (const char *fmt, Args...args) |
Output log message with LOG_INFO level. | |
template<typename... Args> | |
SysLogBase & | Debug (const char *fmt, Args...args) |
Output log message with LOG_DEBUG level. | |
virtual bool | Putc (char c, void *arg)=0 |
Output character to the log. | |
Protected Attributes | |
Level | _curLevel |
Level for the message currently being printed. | |
Level | _maxLevel |
Ignore messages above this level. |
Global system log.
Messages to the system log should be written by methods provided by OTextStream underlying class.
Importance levels for system log messages.
SysLogBase& log::SysLogBase::Alert | ( | const char * | fmt, |
Args... | args | ||
) | [inline] |
Output log message with LOG_ALERT level.
SysLogBase& log::SysLogBase::Critical | ( | const char * | fmt, |
Args... | args | ||
) | [inline] |
Output log message with LOG_CRITICAL level.
SysLogBase& log::SysLogBase::Debug | ( | const char * | fmt, |
Args... | args | ||
) | [inline] |
Output log message with LOG_DEBUG level.
SysLogBase& log::SysLogBase::Error | ( | const char * | fmt, |
Args... | args | ||
) | [inline] |
Output log message with LOG_ERROR level.
SysLogBase& log::SysLogBase::Format | ( | const char * | fmt | ) | [inline] |
This method handles edge case of previous template when only format string is specified.
fmt | Format string. Should not contain any formatting operators. |
Reimplemented from text_stream::OTextStreamBase.
SysLogBase& log::SysLogBase::Format | ( | const char * | fmt, |
Args... | args | ||
) | [inline] |
Output formated string.
Reimplemented from text_stream::OTextStreamBase.
SysLogBase& log::SysLogBase::FormatV | ( | const char * | fmt, |
va_list | args | ||
) | [inline] |
Output formatted string.
It has more limited functionality than Format method because it is not types aware for format arguments. So it cannot format user defined classes. For the same reason it is not safe and should not be used unless absolutely necessary.
fmt | Format to output. |
args | List of variable arguments for a format. |
Reimplemented from text_stream::OTextStreamBase.
SysLogBase& log::SysLogBase::Info | ( | const char * | fmt, |
Args... | args | ||
) | [inline] |
Output log message with LOG_INFO level.
SysLogBase& log::SysLogBase::Notice | ( | const char * | fmt, |
Args... | args | ||
) | [inline] |
Output log message with LOG_NOTICE level.
virtual SysLogBase& log::SysLogBase::operator<< | ( | log::SysLogBase::Level | level | ) | [pure virtual] |
This operator must be overloaded in back-end derived class.
This operator should trigger new message printing transaction. It must at least set _curLevel member.
level | Level of the message. |
Implemented in log::KSysLog.
virtual bool log::SysLogBase::Putc | ( | char | c, |
void * | arg | ||
) | [pure virtual] |
Output character to the log.
Must be overloaded in derived back-end class.
c | Character to output. |
arg | Optional argument. |
Implemented in log::KSysLog.
SysLogBase& log::SysLogBase::Warning | ( | const char * | fmt, |
Args... | args | ||
) | [inline] |
Output log message with LOG_WARNING level.
Level log::SysLogBase::_curLevel [protected] |
Level for the message currently being printed.
Level log::SysLogBase::_maxLevel [protected] |
Ignore messages above this level.