Ogre::Log::Stream Class Reference

Stream object which targets a log. More...

`#include <OgreLog.h>`

List of all members.

## Classes

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

## Public Member Functions

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

## Protected Types

typedef StringUtil::StrStreamType | BaseStream

## Protected Attributes

Log * | mTarget
LogMessageLevel | mLevel
bool | mMaskDebug
BaseStream | mCache

## 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 191 of file OgreLog.h.

## Member Typedef Documentation

typedef StringUtil::StrStreamType Ogre::Log::Stream::BaseStream`[protected]`

Definition at line 197 of file OgreLog.h.

## Constructor & Destructor Documentation

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

Definition at line 205 of file OgreLog.h.

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

Definition at line 211 of file OgreLog.h.

References mCache.

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

Definition at line 217 of file OgreLog.h.

## Member Function Documentation

template<typename T >

Stream& Ogre::Log::Stream::operator<< | ( | const T & | v | ) |

Definition at line 227 of file OgreLog.h.

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

Definition at line 233 of file OgreLog.h.

References Ogre::StringUtil::BLANK.

## Member Data Documentation

BaseStream Ogre::Log::Stream::mCache`[protected]`

Definition at line 198 of file OgreLog.h.

Referenced by Stream().

LogMessageLevel Ogre::Log::Stream::mLevel`[protected]`

Definition at line 195 of file OgreLog.h.

bool Ogre::Log::Stream::mMaskDebug`[protected]`

Definition at line 196 of file OgreLog.h.

Log* Ogre::Log::Stream::mTarget`[protected]`

Definition at line 194 of file OgreLog.h.

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

- OgreLog.h

Copyright © 2008 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Sat Jan 14 2012 18:40:48