OGRE  1.9.0
Ogre::Log::Stream Class Reference

Stream object which targets a log. More...

#include <OgreLog.h>

Classes

struct  Flush
 Simple type to indicate a flush of the stream to the log. More...
 

Public Member Functions

 Stream (const Stream &rhs)
 
 Stream (Log *target, LogMessageLevel lml, bool maskDebug)
 
 ~Stream ()
 
Streamoperator<< (const Flush &v)
 
template<typename T>
Streamoperator<< (const T &v)
 

Protected Types

typedef StringUtil::StrStreamType BaseStream
 

Protected Attributes

BaseStream mCache
 
LogMessageLevel mLevel
 
bool mMaskDebug
 
LogmTarget
 

Detailed Description

Stream object which targets a log.

Remarks
A stream logger object makes it simpler to send various things to a log. You can just use the operator<< implementation to stream anything to the log, which is cached until a Stream::Flush is encountered, or the stream itself is destroyed, at which point the cached contents are sent to the underlying log. You can use Log::stream() directly without assigning it to a local variable and as soon as the streaming is finished, the object will be destroyed and the message logged.
You can stream control operations to this object too, such as std::setw() and std::setfill() to control formatting.
Note
Each Stream object is not thread safe, so do not pass it between threads. Multiple threads can hold their own Stream instances pointing at the same Log though and that is threadsafe.

Definition at line 201 of file OgreLog.h.

Member Typedef Documentation

◆ BaseStream

Definition at line 207 of file OgreLog.h.

Constructor & Destructor Documentation

◆ Stream() [1/2]

Ogre::Log::Stream::Stream ( Log * target,
LogMessageLevel lml,
bool maskDebug )

Definition at line 215 of file OgreLog.h.

References Ogre::Log::Log(), mLevel, mMaskDebug, and mTarget.

Referenced by Stream(), operator<<(), and operator<<().

◆ Stream() [2/2]

Ogre::Log::Stream::Stream ( const Stream & rhs)

Definition at line 221 of file OgreLog.h.

References Stream(), mCache, mLevel, mMaskDebug, and mTarget.

◆ ~Stream()

Ogre::Log::Stream::~Stream ( )

Definition at line 227 of file OgreLog.h.

References mCache, mLevel, mMaskDebug, and mTarget.

Member Function Documentation

◆ operator<<() [1/2]

Stream & Ogre::Log::Stream::operator<< ( const Flush & v)

Definition at line 243 of file OgreLog.h.

References Stream(), Ogre::StringUtil::BLANK, mCache, mLevel, mMaskDebug, and mTarget.

◆ operator<<() [2/2]

template<typename T>
Stream & Ogre::Log::Stream::operator<< ( const T & v)

Definition at line 237 of file OgreLog.h.

References Stream(), and mCache.

Member Data Documentation

◆ mCache

BaseStream Ogre::Log::Stream::mCache
protected

Definition at line 208 of file OgreLog.h.

Referenced by Stream(), ~Stream(), operator<<(), and operator<<().

◆ mLevel

LogMessageLevel Ogre::Log::Stream::mLevel
protected

Definition at line 205 of file OgreLog.h.

Referenced by Stream(), Stream(), ~Stream(), and operator<<().

◆ mMaskDebug

bool Ogre::Log::Stream::mMaskDebug
protected

Definition at line 206 of file OgreLog.h.

Referenced by Stream(), Stream(), ~Stream(), and operator<<().

◆ mTarget

Log* Ogre::Log::Stream::mTarget
protected

Definition at line 204 of file OgreLog.h.

Referenced by Stream(), Stream(), ~Stream(), and operator<<().


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