OGRE  13.6
Object-Oriented Graphics Rendering Engine
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:

Public Member Functions

 LogManager ()
 
 ~LogManager ()
 
LogcreateLog (const String &name, bool defaultLog=false, bool debuggerOutput=true, bool suppressFileOutput=false)
 Creates a new log with the given name. More...
 
void destroyLog (const String &name)
 Closes and removes a named log. More...
 
void destroyLog (Log *log)
 Closes and removes a log. More...
 
LoggetDefaultLog ()
 Returns a pointer to the default log. More...
 
LoggetLog (const String &name)
 Retrieves a log managed by this class. More...
 
void logError (const String &message, bool maskDebug=false)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
void logMessage (const String &message, LogMessageLevel lml=LML_NORMAL, bool maskDebug=false)
 Log a message to the default log. More...
 
void logMessage (LogMessageLevel lml, const String &message, bool maskDebug=false)
 Log a message to the default log (signature for backward compatibility). More...
 
void logWarning (const String &message, bool maskDebug=false)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
LogsetDefaultLog (Log *newLog)
 Sets the passed in log as the default log. More...
 
void setLogDetail (LoggingLevel ll)
 
void setMinLogLevel (LogMessageLevel lml)
 sets the minimal LogMessageLevel for the default log More...
 
Log::Stream stream (LogMessageLevel lml=LML_NORMAL, bool maskDebug=false)
 Get a stream on the default log. More...
 
- Public Member Functions inherited from Ogre::Singleton< LogManager >
 Singleton (void)
 
 ~Singleton (void)
 

Static Public Member Functions

static LogManagergetSingleton (void)
 Get the singleton instance. More...
 
static LogManagergetSingletonPtr (void)
 Get the singleton instance. More...
 
- Static Public Member Functions inherited from Ogre::Singleton< LogManager >
static LogManagergetSingleton (void)
 Get the singleton instance. More...
 
static LogManagergetSingletonPtr (void)
 Get the singleton instance. More...
 

Detailed Description

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

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.
By default, Root will instantiate a LogManager (which becomes the Singleton instance) on construction, and will create a default log based on the Root construction parameters. If you want more control, for example redirecting log output right from the start or suppressing debug output, you need to create a LogManager yourself before creating a Root instance, then create a default log. Root will detect that you've created one yourself and won't create one of its own, thus using all your logging preferences from the first instance.

Constructor & Destructor Documentation

◆ LogManager()

Ogre::LogManager::LogManager ( )

◆ ~LogManager()

Ogre::LogManager::~LogManager ( )

Member Function Documentation

◆ createLog()

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

Creates a new log with the given name.

Parameters
nameThe name to give the log e.g. 'Ogre.log'
defaultLogIf 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.
debuggerOutputIf true, output to this log will also be routed to the debugger's output window.
suppressFileOutputIf true, this is a logical rather than a physical log and no file output will be written. If you do this you should register a LogListener so log output is not lost.

◆ getLog()

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

Retrieves a log managed by this class.

◆ getDefaultLog()

Log* Ogre::LogManager::getDefaultLog ( )

Returns a pointer to the default log.

◆ destroyLog() [1/2]

void Ogre::LogManager::destroyLog ( const String name)

Closes and removes a named log.

◆ destroyLog() [2/2]

void Ogre::LogManager::destroyLog ( Log log)

Closes and removes a log.

◆ setDefaultLog()

Log* Ogre::LogManager::setDefaultLog ( Log newLog)

Sets the passed in log as the default log.

Returns
The previous default log.

◆ logMessage() [1/2]

void Ogre::LogManager::logMessage ( const String message,
LogMessageLevel  lml = LML_NORMAL,
bool  maskDebug = false 
)

Log a message to the default log.

◆ logError()

void Ogre::LogManager::logError ( const String message,
bool  maskDebug = false 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ logWarning()

void Ogre::LogManager::logWarning ( const String message,
bool  maskDebug = false 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Referenced by Ogre::Bullet::DebugDrawer::reportErrorWarning().

◆ logMessage() [2/2]

void Ogre::LogManager::logMessage ( LogMessageLevel  lml,
const String message,
bool  maskDebug = false 
)
inline

Log a message to the default log (signature for backward compatibility).

◆ stream()

Log::Stream Ogre::LogManager::stream ( LogMessageLevel  lml = LML_NORMAL,
bool  maskDebug = false 
)

Get a stream on the default log.

◆ setLogDetail()

void Ogre::LogManager::setLogDetail ( LoggingLevel  ll)

◆ setMinLogLevel()

void Ogre::LogManager::setMinLogLevel ( LogMessageLevel  lml)

sets the minimal LogMessageLevel for the default log

◆ getSingleton()

static LogManager& Ogre::LogManager::getSingleton ( void  )
static

Get the singleton instance.

Referenced by Ogre::Bullet::DebugDrawer::reportErrorWarning().

◆ getSingletonPtr()

static LogManager* Ogre::LogManager::getSingletonPtr ( void  )
static

Get the singleton instance.


The documentation for this class was generated from the following file: