humoto
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
humoto::LoggerBase Class Reference

Detailed Description

Logger base class (stream handling)

Definition at line 287 of file logger.h.

#include <logger.h>

Inheritance diagram for humoto::LoggerBase:
Inheritance graph

Public Member Functions

void initialize (std::ostream &output_stream)
 initialize More...
 
void initialize (const std::string &output_filename)
 initialize More...
 

Protected Member Functions

 LoggerBase ()
 Default constructor. More...
 
 LoggerBase (std::ostream &output_stream)
 Constructor. More...
 
 LoggerBase (const std::string &output_filename)
 Constructor. More...
 
 ~LoggerBase ()
 Destructor. More...
 

Protected Attributes

std::ostream * output_stream_
 Output stream. More...
 

Private Member Functions

void clean ()
 Cleanup before destruction or reinitialization. More...
 
template<typename t_Data >
LoggerBaseoperator<< (const t_Data &data)
 Stream insertion operator. More...
 
LoggerBaseoperator<< (std::ostream &(*manipulator_function)(std::ostream &))
 Stream manipulation. More...
 
void setDefaults ()
 Initialize output parameters. More...
 

Private Attributes

bool file_stream_is_open_
 Set if file stream is open. More...
 
std::ofstream output_file_stream_
 Output file stream (not used if a stream given to constructor) More...
 

Constructor & Destructor Documentation

◆ LoggerBase() [1/3]

humoto::LoggerBase::LoggerBase ( )
inlineprotected

Default constructor.

Definition at line 364 of file logger.h.

◆ LoggerBase() [2/3]

humoto::LoggerBase::LoggerBase ( std::ostream &  output_stream)
inlineexplicitprotected

Constructor.

Parameters
[in,out]output_streamoutput stream

Definition at line 376 of file logger.h.

◆ LoggerBase() [3/3]

humoto::LoggerBase::LoggerBase ( const std::string &  output_filename)
inlineexplicitprotected

Constructor.

Parameters
[in]output_filenamename of the log file

Definition at line 387 of file logger.h.

◆ ~LoggerBase()

humoto::LoggerBase::~LoggerBase ( )
inlineprotected

Destructor.

Definition at line 396 of file logger.h.

Member Function Documentation

◆ clean()

void humoto::LoggerBase::clean ( )
inlineprivate

Cleanup before destruction or reinitialization.

Definition at line 310 of file logger.h.

◆ initialize() [1/2]

void humoto::LoggerBase::initialize ( std::ostream &  output_stream)
inline

initialize

Parameters
[in,out]output_streamoutput stream

Definition at line 409 of file logger.h.

◆ initialize() [2/2]

void humoto::LoggerBase::initialize ( const std::string &  output_filename)
inline

initialize

Parameters
[in]output_filenamename of the log file

Definition at line 423 of file logger.h.

◆ operator<<() [1/2]

template<typename t_Data >
LoggerBase& humoto::LoggerBase::operator<< ( const t_Data &  data)
inlineprivate

Stream insertion operator.

Template Parameters
t_Dataoutput data type
Parameters
[in]datadata
Returns
Logger

Definition at line 332 of file logger.h.

◆ operator<<() [2/2]

LoggerBase& humoto::LoggerBase::operator<< ( std::ostream &(*)(std::ostream &)  manipulator_function)
inlineprivate

Stream manipulation.

Parameters
[in]manipulator_functionstream manipulation function
Returns
Logger

Definition at line 347 of file logger.h.

◆ setDefaults()

void humoto::LoggerBase::setDefaults ( )
inlineprivate

Initialize output parameters.

Definition at line 301 of file logger.h.

Member Data Documentation

◆ file_stream_is_open_

bool humoto::LoggerBase::file_stream_is_open_
private

Set if file stream is open.

Definition at line 291 of file logger.h.

◆ output_file_stream_

std::ofstream humoto::LoggerBase::output_file_stream_
private

Output file stream (not used if a stream given to constructor)

Definition at line 294 of file logger.h.

◆ output_stream_

std::ostream* humoto::LoggerBase::output_stream_
protected

Output stream.

Definition at line 357 of file logger.h.


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