Loading...
Searching...
No Matches
Ogre::Log Class Reference
Core » General

Log class for writing debug/log data to files. More...

`#include <OgreLog.h>`

Inheritance diagram for Ogre::Log:
[legend]

## Classes

class | Stream
| Stream object which targets a log. More...

## Public Member Functions

| Log (const String &name, bool debugOutput=true, bool suppressFileOutput=false)
| Usual constructor - called by LogManager.
| ~Log ()
| Default destructor.
void | addListener (LogListener *listener)
| Register a listener to this log.
LogMessageLevel | getMinLogLevel () const
| Gets the level of the log detail.
const String & | getName () const
| Return the name of the log.
bool | isDebugOutputEnabled () const
| Get whether debug output is enabled for this log.
bool | isFileOutputSuppressed () const
| Get whether file output is suppressed for this log.
bool | isTimeStampEnabled () const
| Get whether time stamps are printed for this log.
void | logMessage (const String &message, LogMessageLevel lml=LML_NORMAL, bool maskDebug=false)
| Log a message to the debugger and to log file (the default is "<code>OGRE.log</code>"),.
void | removeListener (LogListener *listener)
| Unregister a listener from this log.
void | setDebugOutputEnabled (bool debugOutput)
| Enable or disable outputting log messages to the debugger.
void | setLogDetail (LoggingLevel ll)
void | setMinLogLevel (LogMessageLevel lml)
| set the minimal LogMessageLevel for a message to be logged
void | setTimeStampEnabled (bool timeStamp)
| Enable or disable time stamps.
Stream | stream (LogMessageLevel lml=LML_NORMAL, bool maskDebug=false)
| Get a stream object targeting this log.

## Detailed Description

Log class for writing debug/log data to files.

You can control the default log level through the OGRE_MIN_LOGLEVEL environment variable. Here, the value 1 corresponds to LML_TRIVIAL etc.

Note
  Should not be used directly, but through the LogManager class.

## Constructor & Destructor Documentation

## Log()

Ogre::Log::Log | ( | const String & | name,
|  | bool | debugOutput = true,
|  | bool | suppressFileOutput = false )

Usual constructor - called by LogManager.

Referenced by Ogre::Log::Stream::Stream().

## ~Log()

Ogre::Log::~Log | ( |  | ) |

Default destructor.

## Member Function Documentation

## getName()

const String & Ogre::Log::getName | ( |  | ) | const

inline

Return the name of the log.

## isDebugOutputEnabled()

bool Ogre::Log::isDebugOutputEnabled | ( |  | ) | const

inline

Get whether debug output is enabled for this log.

## isFileOutputSuppressed()

bool Ogre::Log::isFileOutputSuppressed | ( |  | ) | const

inline

Get whether file output is suppressed for this log.

## isTimeStampEnabled()

bool Ogre::Log::isTimeStampEnabled | ( |  | ) | const

inline

Get whether time stamps are printed for this log.

## logMessage()

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

Log a message to the debugger and to log file (the default is "<code>OGRE.log</code>"),.

References Ogre::LML_NORMAL.

## stream()

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

Get a stream object targeting this log.

References Ogre::LML_NORMAL.

## setDebugOutputEnabled()

void Ogre::Log::setDebugOutputEnabled | ( | bool | debugOutput | ) |

Enable or disable outputting log messages to the debugger.

## setLogDetail()

void Ogre::Log::setLogDetail | ( | LoggingLevel | ll | ) |

Deprecated
  use setMinLogLevel()

## setMinLogLevel()

void Ogre::Log::setMinLogLevel | ( | LogMessageLevel | lml | ) |

set the minimal LogMessageLevel for a message to be logged

## setTimeStampEnabled()

void Ogre::Log::setTimeStampEnabled | ( | bool | timeStamp | ) |

Enable or disable time stamps.

## getMinLogLevel()

LogMessageLevel Ogre::Log::getMinLogLevel | ( |  | ) | const

inline

Gets the level of the log detail.

## addListener()

void Ogre::Log::addListener | ( | LogListener * | listener | ) |

Register a listener to this log.

Parameters

  listener | A valid listener derived class

## removeListener()

void Ogre::Log::removeListener | ( | LogListener * | listener | ) |

Unregister a listener from this log.

Parameters

  listener | A valid listener derived class

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

- OgreLog.h