xlog::Logger Class Reference

The logger class. More...

#include <logger.h>

List of all members.

Public Types

typedef std::list< Log * > container_type
 The container type.

Public Member Functions

 Logger (modules::Core &core, LogRules const &rules)
 Constructor.
 Logger (Logger const &l)
 Copy constructor.
Loggeroperator= (Logger const &right)
 Assignment operator.
void log (LogLevel const &level, char const *format,...) FORMAT(printf
 Logs a message.
void void register_interface (Log &interface)
 Registers a log interface.
void unregister_interface (Log &interface)
 Unregisters a log interface.
void vlog (LogLevel const &level, char const *format, va_list args)
 Same as log(), but using variable argument lists.

Static Public Attributes

static int const msg_length = 2048
 Maximum length for log messages.


Detailed Description

A logger is used to log stuff to standard output (when the program runs in foreground) and forward messages to log interfaces so they can log whatever they want the way they want.


Constructor & Destructor Documentation

xlog::Logger::Logger ( modules::Core core,
LogRules const &  rules 
) [inline, explicit]

Constructor.

Parameters:
[in] core The core module (must remain valid until the logger is destructed).
[in] rules The LogRules directive that determines what gets logged to the standard output.


Member Function Documentation

void xlog::Logger::log ( LogLevel const &  level,
char const *  format,
  ... 
)

Logs a message. The message will be forwarded to all log interfaces and, if the program doesn't run in background, printed to either stdout or stderr.

Parameters:
[in] level The log level of the message.
[in] format A format string for the message, similar to the one used by the printf() family of functions.
[in] ... Parameters for the format string.

void void xlog::Logger::register_interface ( Log interface  ) 

Registers a log interface. The interface must remain valid until it is registered (it is NOT copied).

Don't forget to unregister the interface before it is destructed, or there'll be troubles.

Parameters:
[in] interface The log interface to register.
See also:
unregister_interface()

void xlog::Logger::unregister_interface ( Log interface  ) 

Unregisters a previously registered log interface.

Parameters:
[in] interface The log interface to unregister.
See also:
register_interface()


The documentation for this class was generated from the following file:
Generated on Wed Aug 15 00:37:23 2007 for Epona API by  doxygen 1.5.2