FREEDM DGI
Public Member Functions | Private Attributes | List of all members
freedm::broker::CLog Class Reference

Logging Output Software.

#include <CLogger.hpp>

Inheritance diagram for freedm::broker::CLog:

Public Member Functions

 CLog (const CLoggerPointer p, const unsigned int level_, const std::string name_, std::ostream *const out_=&std::clog)
 Constructor; prepares a log of a specified level. More...
 
unsigned int GetOutputLevel () const
 Determine the level of this logger. More...
 
std::streamsize write (const char *const s, std::streamsize n)
 Writes from a character array into the logger stream. More...
 

Private Attributes

unsigned int m_level
 The level of this logger. More...
 
const std::string m_name
 String name of this logger. More...
 
std::ostream *const m_ostream
 Output stream to use. More...
 
const CLoggerPointer m_parent
 The local logger managing this logger. More...
 

Constructor & Destructor Documentation

freedm::broker::CLog::CLog ( const CLoggerPointer  p,
const unsigned int  level_,
const std::string  name_,
std::ostream *const  out_ = &std::clog 
)
Description:
A specific logging stream interface.
Limitations:
Relies on having a parent LocalLogger to ask for its output level

CLog::CLog

Description:
Log constructor
Parameters
pThe parent logger object that manages this log
level_the output level of this log.
name_the name of this log
out_the stream that the messages sent to this log will be written.
Precondition:
None
Postcondition:
None

Member Function Documentation

unsigned int freedm::broker::CLog::GetOutputLevel ( ) const

CLog::GetOutputLevel

Description:
Get's the output level (which messages to show) from the CLogger that owns this log.
Precondition:
None
Postcondition:
None
Returns
The output level of the Logger.
std::streamsize freedm::broker::CLog::write ( const char *const  s,
std::streamsize  n 
)

CLog::write

Description:
Given an input array of characters, write that stream to the screen with information about the log that captured those messages
Parameters
sAn array of characters to write to the log's stream.
nThe size of the array that will be written
Precondition:
None
Postcondition:
The array is written to the log's stream if the level of the message is greater than the Log's OutputLevel.
Returns
the number of characters written to the stream.

Member Data Documentation

unsigned int freedm::broker::CLog::m_level
private
const std::string freedm::broker::CLog::m_name
private
std::ostream* const freedm::broker::CLog::m_ostream
private
const CLoggerPointer freedm::broker::CLog::m_parent
private

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