Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Ogre::LogManager Class Reference

The log manager handles the creation and retrieval of logs for the application. More...

#include <OgreLogManager.h>

Inheritance diagram for Ogre::LogManager:

Ogre::Singleton< LogManager > List of all members.

Public Methods

 LogManager ()
 ~LogManager ()
LogcreateLog (const String &name, bool defaultLog=false, bool debuggerOutput=true)
 Creates a new log with the given name. More...

LoggetLog (const String &name)
 Retrieves a log managed by this class. More...

LoggetDefaultLog ()
 Returns a pointer to the default log. More...

void logMessage (const String &message, LogMessageLevel lml=LML_NORMAL)
 Log a message to the default log. More...

void logMessage (LogMessageLevel lml, const char *szMessage,...)
 Log a message, smarter form - allows a variable number of arguments. More...

void setLogDetail (LoggingLevel ll)
 Sets the level of detail of the default log. More...


Static Public Methods

LogManager & getSingleton (void)
 Override standard Singleton retrieval. More...

LogManager * getSingletonPtr (void)

Protected Types

typedef std::map< String,
Log *, std::less< String > > 
LogList

Protected Attributes

LogList mLogs
 A list of all the logs the manager can access. More...

LogmDefaultLog
 The default log to which output is done. More...


Static Protected Attributes

LogManager * ms_Singleton = 0

Detailed Description

The log manager handles the creation and retrieval of logs for the application.

Remarks:
This class will create new log files and will retrieve instances of existing ones. Other classes wishing to log output can either create a fresh log or retrieve an existing one to output to. One log is the default log, and is the one written to when the logging methods of this class are called.


Member Typedef Documentation

typedef std::map<String, Log*, std::less<String> > Ogre::LogManager::LogList [protected]
 


Constructor & Destructor Documentation

Ogre::LogManager::LogManager  
 

Ogre::LogManager::~LogManager  
 


Member Function Documentation

Log * Ogre::LogManager::createLog const String   name,
bool    defaultLog = false,
bool    debuggerOutput = true
 

Creates a new log with the given name.

Parameters:
name  The name to give the log e.g. 'Ogre.log'
defaultLog  If true, this is the default log output will be sent to if the generic logging methods on this class are used. The first log created is always the default log unless this parameter is set.
debuggerOutput  If true, output to this log will also be routed to the debugger's output window.

Log * Ogre::LogManager::getDefaultLog  
 

Returns a pointer to the default log.

Log * Ogre::LogManager::getLog const String   name
 

Retrieves a log managed by this class.

LogManager & Ogre::LogManager::getSingleton void    [static]
 

Override standard Singleton retrieval.

Remarks:
Why do we do this? Well, it's because the Singleton implementation is in a .h file, which means it gets compiled into anybody who includes it. This is needed for the Singleton template to work, but we actually only want it compiled into the implementation of the class based on the Singleton, not all of them. If we don't change this, we get link errors when trying to use the Singleton-based class from an outside dll.

This method just delegates to the template version anyway, but the implementation stays in this single compilation unit, preventing link errors.

Reimplemented from Ogre::Singleton< LogManager >.

LogManager* Ogre::Singleton< LogManager >::getSingletonPtr void    [inline, static, inherited]
 

void Ogre::LogManager::logMessage LogMessageLevel    lml,
const char *    szMessage,
...   
 

Log a message, smarter form - allows a variable number of arguments.

Note:

The longest string that this function can output is 4096 characters long.

void Ogre::LogManager::logMessage const String   message,
LogMessageLevel    lml = LML_NORMAL
 

Log a message to the default log.

void Ogre::LogManager::setLogDetail LoggingLevel    ll
 

Sets the level of detail of the default log.


Member Data Documentation

Log* Ogre::LogManager::mDefaultLog [protected]
 

The default log to which output is done.

LogList Ogre::LogManager::mLogs [protected]
 

A list of all the logs the manager can access.

LogManager * Ogre::Singleton< LogManager >::ms_Singleton = 0 [static, protected, inherited]
 

Copyright © 2002 by The OGRE Team