SpinParser  1.0
Public Member Functions | Friends | List of all members
Log::Logstream Class Reference

Log stream object for simple output filtering. More...

#include <Log.hpp>

Public Member Functions

 Logstream (std::ostream &logTarget)
 Construct a new Logstream object with log filtering to Log::LogLevel::Info.
 
Logstreamoperator<< (const Log::LogLevel &rhs)
 Output operator for LogLevel objects to set filter level. More...
 
Logstreamoperator<< (const Manipulator &rhs)
 Apply plain output manipulator to log stream. More...
 
Logstreamoperator<< (const StructManipulator &rhs)
 Apply structured output manipulator to log stream. More...
 

Friends

Logstreamendl (Logstream &ls)
 Output modifier to print new line. More...
 
StructManipulator setDisplayLogLevel (const Log::LogLevel logLevel)
 Generate output modifier to set the display log level filter. More...
 
StructManipulator setLogLevel (const Log::LogLevel logLevel)
 Generate output modifier to change the log level. More...
 
template<class T >
Logstreamoperator<< (Logstream &ls, const T &rhs)
 Output operator for messages of arbitrary type. Will accept any log object that implements the output operator for stdout. More...
 

Detailed Description

Log stream object for simple output filtering.

The Logstream object provides output filtering accordign to a selected log level. The filtered output is written to stdout. Any output generated is printed with a timestamp, measring the time since creation of the Logstream object.

Member Function Documentation

◆ operator<<() [1/3]

Logstream& Log::Logstream::operator<< ( const Log::LogLevel rhs)
inline

Output operator for LogLevel objects to set filter level.

Parameters
rhsNew LogLevel value.
Returns
Logstream& Reference to self.

◆ operator<<() [2/3]

Logstream& Log::Logstream::operator<< ( const Manipulator &  rhs)
inline

Apply plain output manipulator to log stream.

Parameters
rhsLogstream manipulator.
Returns
Logstream& Reference to self.

◆ operator<<() [3/3]

Logstream& Log::Logstream::operator<< ( const StructManipulator rhs)
inline

Apply structured output manipulator to log stream.

Parameters
rhsLogstream manipulator.
Returns
Logstream& Reference to self.

Friends And Related Function Documentation

◆ endl

Logstream& endl ( Logstream ls)
friend

Output modifier to print new line.

Parameters
lsTarget Logstream object.
Returns
Logstream& Reference to self.

◆ operator<<

template<class T >
Logstream& operator<< ( Logstream ls,
const T &  rhs 
)
friend

Output operator for messages of arbitrary type. Will accept any log object that implements the output operator for stdout.

Template Parameters
Typeof the log message.
Parameters
lsTarget Logstream object.
rhsLog message to be written.
Returns
Logstream& Reference to Logstream operand.

◆ setDisplayLogLevel

StructManipulator setDisplayLogLevel ( const Log::LogLevel  logLevel)
friend

Generate output modifier to set the display log level filter.

Parameters
logLevelFilter level.
Returns
StructManipulator Logstream manipulator.

◆ setLogLevel

StructManipulator setLogLevel ( const Log::LogLevel  logLevel)
friend

Generate output modifier to change the log level.

Parameters
logLevelNew log level.
Returns
StructManipulator Logstream manipulator.

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