OpenGUI::LogManager Class Reference

#include <OpenGUI_LogSystem.h>

List of all members.


Detailed Description

Central log manager. Logging messages can be sent through this object, or a specific Log object.


Public Member Functions

void logMsg (const String &log, const String &message, unsigned int logLevel)
 Send a message through the given log.
LogMessage & logMsg (const String &log, unsigned int logLevel)
 A stream like interface for writing to logs.
void setLogListener (LogListener *listener)
 Sets the used log listener to the given listener. Only 1 LogListener is used at a time.
void setLevel (unsigned int logLevel)
 Sets the log level that is applied to all messages. This check occurs after the log specific checks.
LogcreateLog (const String &name)
 Explicitly create a new log.
LoggetLog (const String &name)
 Get a log by name.
void destroyLog (const String &name)
 Destroy a log by name.

Static Public Member Functions

static LogManagergetSingleton (void)
 Retrieve the current singleton, if one exists. If none exists, this will cause an error.
static LogManagergetSingletonPtr (void)
 Retrieve a pointer to the current singleton, if one exists. If none exists, this will return 0.
static LogMessage & SlogMsg (const String &log, unsigned int logLevel)
 Same as logMsg, but implemented as a static function, with automatic singleton dereferencing. Should help make your code a little smaller.


Member Function Documentation

Log * OpenGUI::LogManager::createLog const String name  ) 
 

Explicitly create a new log.

Note:
Log names are case sensitive

void OpenGUI::LogManager::destroyLog const String name  ) 
 

Destroy a log by name.

Log * OpenGUI::LogManager::getLog const String name  ) 
 

Get a log by name.

LogManager & OpenGUI::LogManager::getSingleton void   )  [static]
 

Retrieve the current singleton, if one exists. If none exists, this will cause an error.

LogManager * OpenGUI::LogManager::getSingletonPtr void   )  [static]
 

Retrieve a pointer to the current singleton, if one exists. If none exists, this will return 0.

LogMessage & OpenGUI::LogManager::logMsg const String log,
unsigned int  logLevel
 

A stream like interface for writing to logs.

This should be pretty simple to use for just about everyone. Works just like standard C++ stream (since it is based off of them). myLogmanagerPtr->logMsg("myLog", 1) << "Here is my log entry, and the number " << 4 << Log::end;

void OpenGUI::LogManager::logMsg const String log,
const String message,
unsigned int  logLevel
 

Send a message through the given log.

This is equivalent to getLog(log)->write(message, logLevel);
If log does not yet exist, it will be created.

void OpenGUI::LogManager::setLevel unsigned int  logLevel  ) 
 

Sets the log level that is applied to all messages. This check occurs after the log specific checks.

void OpenGUI::LogManager::setLogListener LogListener listener  ) 
 

Sets the used log listener to the given listener. Only 1 LogListener is used at a time.

If you want more than 1 output stream, do it in a custom LogListener.

static LogMessage& OpenGUI::LogManager::SlogMsg const String log,
unsigned int  logLevel
[inline, static]
 

Same as logMsg, but implemented as a static function, with automatic singleton dereferencing. Should help make your code a little smaller.


The documentation for this class was generated from the following files:
Copyright © 2006 OpenGUI | OpenGUI.SF.net
Generated: Sun Sep 9 02:00:21 2007