FMT 0.9.8
Forest management tools for forest planning
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
Logging::FMTlogger Class Reference

#include <FMTlogger.hpp>

Inheritance diagram for Logging::FMTlogger:
[legend]
Collaboration diagram for Logging::FMTlogger:
[legend]

Public Member Functions

 FMTlogger ()
 
virtual ~FMTlogger ()
 
 FMTlogger (const FMTlogger &rhs)
 
void redirectofile (const std::string &filename)
 
void closefilestream ()
 
FMTloggeroperator= (const FMTlogger &rhs)
 
virtual int print ()
 
virtual void checkSeverity ()
 
virtual FMTloggerclone () const
 
virtual std::string getlogstamp () const
 
virtual void logstamp ()
 
virtual void logtime ()
 
void setstreamflush (bool flush)
 
virtual FMTloggeroperator<< (const std::string &msg)
 
virtual FMTloggeroperator<< (const int &msg)
 
virtual FMTloggeroperator<< (const double &msg)
 
virtual FMTloggeroperator<< (const float &msg)
 
virtual FMTloggeroperator<< (const std::time_t &msg)
 
virtual FMTloggeroperator<< (const size_t &msg)
 
virtual FMTloggeroperator<< (const unsigned int &msg)
 
virtual bool logwithlevel (const std::string &msg, const int &messagelevel) const
 
virtual FMTsolverloggergetsolverlogger ()
 

Protected Member Functions

virtual void cout (const char *message) const
 
virtual void setlogginglevel (const int &level)
 

Protected Attributes

std::unique_ptr< FMTsolverloggersolverref
 
std::string filepath
 string path the the potential filestream
 
std::ofstream * filestream
 stream if the logger redirect the logging into somesort of file.
 
boost::recursive_mutex mtx
 Mutex for multi-threading.
 
bool flushstream
 If true will flush stream at each write.
 

Friends

class boost::serialization::access
 

Detailed Description

FMTlogger is a base class who handle the level of stuff printed with FMT. If FMT is compiled with Osisolverinterface then this class is going to be derived from the Coinmessagehandler class to help handling the log level of the solvers.

Constructor & Destructor Documentation

◆ FMTlogger() [1/2]

Logging::FMTlogger::FMTlogger ( )

FMTlogger default constructor.

◆ ~FMTlogger()

virtual Logging::FMTlogger::~FMTlogger ( )
virtual

FMTlogger default destructor.

◆ FMTlogger() [2/2]

Logging::FMTlogger::FMTlogger ( const FMTlogger rhs)

FMTlogger copy constructor.

Member Function Documentation

◆ checkSeverity()

virtual void Logging::FMTlogger::checkSeverity ( )
virtual

FMTlogger check the severity of the message to be print by the coinmessagehandler base class.

Reimplemented in Logging::FMTdebuglogger, Logging::FMTdefaultlogger, Logging::FMTquietlogger, and Logging::FMTtasklogger.

◆ clone()

virtual FMTlogger * Logging::FMTlogger::clone ( ) const
virtual

Clone function needed for the usage of abstract

Reimplemented in Logging::FMTdebuglogger, Logging::FMTdefaultlogger, Logging::FMTquietlogger, and Logging::FMTtasklogger.

◆ closefilestream()

void Logging::FMTlogger::closefilestream ( )

Close the file stream if error occured.

◆ cout()

virtual void Logging::FMTlogger::cout ( const char *  message) const
protectedvirtual

cout function of the logger sometimes on Windows if using boost::python the std::cout needs a little help to print directly into the python window.

Reimplemented in Logging::FMTquietlogger.

◆ getlogstamp()

virtual std::string Logging::FMTlogger::getlogstamp ( ) const
virtual

Return the basic logstamp has a string.

◆ getsolverlogger()

virtual FMTsolverlogger * Logging::FMTlogger::getsolverlogger ( )
virtual

Return the ABSTRACT logger used by osisolverinterface.

◆ logstamp()

virtual void Logging::FMTlogger::logstamp ( )
virtual

The logstramp function log information about the version of FMT and it's buildate.

◆ logtime()

virtual void Logging::FMTlogger::logtime ( )
virtual

The logtime function log the actual time at which the function is called.

◆ logwithlevel()

virtual bool Logging::FMTlogger::logwithlevel ( const std::string &  msg,
const int &  messagelevel 
) const
virtual

Log a message with a given message level if message level is greater of equal to the logger level then it will be printed

◆ operator<<() [1/7]

virtual FMTlogger & Logging::FMTlogger::operator<< ( const double &  msg)
virtual

This function is the main function to add up double.

◆ operator<<() [2/7]

virtual FMTlogger & Logging::FMTlogger::operator<< ( const float &  msg)
virtual

This function is the main function to add up float.

◆ operator<<() [3/7]

virtual FMTlogger & Logging::FMTlogger::operator<< ( const int &  msg)
virtual

This function is the main function to add up int.

◆ operator<<() [4/7]

virtual FMTlogger & Logging::FMTlogger::operator<< ( const size_t &  msg)
virtual

This function is the main function to add up size_t.

◆ operator<<() [5/7]

virtual FMTlogger & Logging::FMTlogger::operator<< ( const std::string &  msg)
virtual

This function is the main function to add up string.

◆ operator<<() [6/7]

virtual FMTlogger & Logging::FMTlogger::operator<< ( const std::time_t &  msg)
virtual

This function is the main function to add up std::time_t.

◆ operator<<() [7/7]

virtual FMTlogger & Logging::FMTlogger::operator<< ( const unsigned int &  msg)
virtual

This function is the main function to add up unsigned int.

◆ operator=()

FMTlogger & Logging::FMTlogger::operator= ( const FMTlogger rhs)

FMTlogger copy assignment operator.

◆ print()

virtual int Logging::FMTlogger::print ( )
virtual

FMTlogger print function if we are using Osisolverinterface the coinmessagehandler print function needs to be overloaded.

Reimplemented in Logging::FMTdebuglogger, Logging::FMTdefaultlogger, Logging::FMTquietlogger, and Logging::FMTtasklogger.

◆ redirectofile()

void Logging::FMTlogger::redirectofile ( const std::string &  filename)

Redirect the log information to a file.

◆ setlogginglevel()

virtual void Logging::FMTlogger::setlogginglevel ( const int &  level)
protectedvirtual

Set the solverlogger logging level

◆ setstreamflush()

void Logging::FMTlogger::setstreamflush ( bool  flush)

Force the flushing on file stream

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Member Data Documentation

◆ filepath

std::string Logging::FMTlogger::filepath
protected

string path the the potential filestream

◆ filestream

std::ofstream* Logging::FMTlogger::filestream
mutableprotected

stream if the logger redirect the logging into somesort of file.

◆ flushstream

bool Logging::FMTlogger::flushstream
protected

If true will flush stream at each write.

◆ mtx

boost::recursive_mutex Logging::FMTlogger::mtx
mutableprotected

Mutex for multi-threading.

◆ solverref

std::unique_ptr<FMTsolverlogger> Logging::FMTlogger::solverref
protected

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