Spinning Topp Logo BlackTopp Studios
inc
Public Member Functions | List of all members
LogStream< CharType, CharTraits > Class Template Reference

A stream that tracks its own level of logging. More...

#include <streamlogging.h>

+ Inheritance diagram for LogStream< CharType, CharTraits >:
+ Collaboration diagram for LogStream< CharType, CharTraits >:

Public Member Functions

 LogStream (std::basic_ostream< CharType, CharTraits > &OutputStream, LogLevel WillLog=LL_Highest)
 Buffer Stealing Constructor. More...
 
LogLevel GetLoggingLevel ()
 What will currently be logged? More...
 
LogStream< CharType, CharTraits > & operator<< (LogStream< CharType, CharTraits > &(*pf)(LogStream< CharType, CharTraits > &))
 Custom Manipulator inserter. More...
 
void SetLoggingLevel (LogLevel NewLevel)
 Change the level of what this Stream is logging. More...
 

Detailed Description

template<class CharType, class CharTraits = std::char_traits<CharType>>
class LogStream< CharType, CharTraits >

A stream that tracks its own level of logging.

Template Parameters
CharTypeThis is kind of character that the stream will work with.
CharTraitsThe traits (move, equality, assignment, etc...) of the character type passed in

Instances of this stream can be configured to treat log messages differently depending on the LogLevel of the message and Level actively being logged. In other regards this is a normal output stream.

Definition at line 159 of file streamlogging.h.

Constructor & Destructor Documentation

template<class CharType, class CharTraits = std::char_traits<CharType>>
LogStream< CharType, CharTraits >::LogStream ( std::basic_ostream< CharType, CharTraits > &  OutputStream,
LogLevel  WillLog = LL_Highest 
)
inline

Buffer Stealing Constructor.

When used to create a LogStream this will use the rdbuf of another std::basic_ostream

Parameters
OutputStreamThis is the stream to steal the buffer from
WillLogThe starting LogLevel to capture, which Defaults to LL_Highest.

Definition at line 171 of file streamlogging.h.

Member Function Documentation

template<class CharType, class CharTraits = std::char_traits<CharType>>
LogLevel LogStream< CharType, CharTraits >::GetLoggingLevel ( )
inline

What will currently be logged?

Returns
A LogLevel that is the bitmap of what will be logged.

Definition at line 183 of file streamlogging.h.

template<class CharType, class CharTraits = std::char_traits<CharType>>
LogStream<CharType, CharTraits>& LogStream< CharType, CharTraits >::operator<< ( LogStream< CharType, CharTraits > &(*)(LogStream< CharType, CharTraits > &)  pf)
inline

Custom Manipulator inserter.

Parameters
pfAccepts a pointer to a LogStream Manipulator
Returns
Whatever stream the manipulator returns which should be *this.

Definition at line 189 of file streamlogging.h.

template<class CharType, class CharTraits = std::char_traits<CharType>>
void LogStream< CharType, CharTraits >::SetLoggingLevel ( LogLevel  NewLevel)
inline

Change the level of what this Stream is logging.

Parameters
NewLevelAfter this returns any messages sent to this stream will be compared against this.

Definition at line 178 of file streamlogging.h.


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