Phoenix
Object-oriented orthogonally persistent operating system
Public Types | Public Member Functions | Protected Attributes
log::SysLogBase Class Reference

Global system log. More...

#include <log.h>

Inheritance diagram for log::SysLogBase:
Collaboration diagram for log::SysLogBase:

List of all members.

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 SysLogBaseoperator<< (log::SysLogBase::Level level)=0
 This operator must be overloaded in back-end derived class.
template<typename... Args>
SysLogBaseFormat (const char *fmt, Args...args)
 Output formated string.
SysLogBaseFormat (const char *fmt)
 This method handles edge case of previous template when only format string is specified.
SysLogBaseFormatV (const char *fmt, va_list args)
 Output formatted string.
template<typename... Args>
SysLogBaseAlert (const char *fmt, Args...args)
 Output log message with LOG_ALERT level.
template<typename... Args>
SysLogBaseCritical (const char *fmt, Args...args)
 Output log message with LOG_CRITICAL level.
template<typename... Args>
SysLogBaseError (const char *fmt, Args...args)
 Output log message with LOG_ERROR level.
template<typename... Args>
SysLogBaseWarning (const char *fmt, Args...args)
 Output log message with LOG_WARNING level.
template<typename... Args>
SysLogBaseNotice (const char *fmt, Args...args)
 Output log message with LOG_NOTICE level.
template<typename... Args>
SysLogBaseInfo (const char *fmt, Args...args)
 Output log message with LOG_INFO level.
template<typename... Args>
SysLogBaseDebug (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.

Detailed Description

Global system log.

Messages to the system log should be written by methods provided by OTextStream underlying class.


Member Enumeration Documentation

Importance levels for system log messages.

Enumerator:
LOG_ALERT 

Fatal or unrecoverable fault occurred.

LOG_CRITICAL 

Critical conditions, action must be taken immediately.

LOG_ERROR 

Error conditions.

LOG_WARNING 

Warning conditions.

LOG_NOTICE 

Normal, but significant, condition.

LOG_INFO 

Informational message.

LOG_DEBUG 

Debug-level message.


Member Function Documentation

template<typename... Args>
SysLogBase& log::SysLogBase::Alert ( const char *  fmt,
Args...  args 
) [inline]

Output log message with LOG_ALERT level.

template<typename... Args>
SysLogBase& log::SysLogBase::Critical ( const char *  fmt,
Args...  args 
) [inline]

Output log message with LOG_CRITICAL level.

template<typename... Args>
SysLogBase& log::SysLogBase::Debug ( const char *  fmt,
Args...  args 
) [inline]

Output log message with LOG_DEBUG level.

template<typename... Args>
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.

Parameters:
fmtFormat string. Should not contain any formatting operators.

Reimplemented from text_stream::OTextStreamBase.

template<typename... Args>
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.

Parameters:
fmtFormat to output.
argsList of variable arguments for a format.
Returns:
Number of characters written.

Reimplemented from text_stream::OTextStreamBase.

template<typename... Args>
SysLogBase& log::SysLogBase::Info ( const char *  fmt,
Args...  args 
) [inline]

Output log message with LOG_INFO level.

template<typename... Args>
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.

Parameters:
levelLevel of the message.
Returns:
Reference to itself.

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.

Parameters:
cCharacter to output.
argOptional argument.
Returns:
true if end of back-end stream is not yet reached, false otherwise.

Implemented in log::KSysLog.

template<typename... Args>
SysLogBase& log::SysLogBase::Warning ( const char *  fmt,
Args...  args 
) [inline]

Output log message with LOG_WARNING level.


Member Data Documentation

Level for the message currently being printed.

Ignore messages above this level.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines