![]() |
FMT 1.2.0
Forest management tools for forest planning
|
Base class handling the level of information printed by FMT. More...
#include <FMTLogger.h>
Public Member Functions | |
| FMTLogger () | |
| Default constructor for FMTLogger. | |
| virtual | ~FMTLogger () |
| Default destructor for FMTLogger. | |
| FMTLogger (const FMTLogger &rhs) | |
| Copy constructor for FMTLogger. | |
| void | redirectToFile (const std::string &filename, bool logStamp=true) |
| Redirect the log information to a file. | |
| void | closeFileStream () |
| Close the file stream. | |
| FMTLogger & | operator= (const FMTLogger &rhs) |
| Copy assignment operator for FMTLogger. | |
| virtual int | print () |
| Print function overloaded from CoinMessageHandler when using the OSI solver interface. | |
| virtual void | checkSeverity () |
| Check the severity of the message to be printed by the CoinMessageHandler base class. | |
| virtual FMTLogger * | clone () const =0 |
| Clone the logger, needed for the abstract CoinMessageHandler usage. | |
| virtual std::string | getLogStamp () const |
| Return the basic log stamp as a string. | |
| virtual void | logStamp () |
| Log information about the version of FMT and its build date. | |
| virtual void | logTime () |
| Log the actual time at which the function is called. | |
| void | setStreamFlush (bool flush) |
| Force the flushing of the file stream. | |
| virtual FMTLogger & | operator<< (const std::string &msg) |
| Append a string to the log. | |
| virtual FMTLogger & | operator<< (const int &msg) |
| Append an int to the log. | |
| virtual FMTLogger & | operator<< (const double &msg) |
| Append a double to the log. | |
| virtual FMTLogger & | operator<< (const float &msg) |
| Append a float to the log. | |
| virtual FMTLogger & | operator<< (const std::time_t &msg) |
| Append a std::time_t to the log. | |
| virtual FMTLogger & | operator<< (const size_t &msg) |
| Append a size_t to the log. | |
| virtual FMTLogger & | operator<< (const unsigned int &msg) |
| Append an unsigned int to the log. | |
| virtual FMTLogger & | operator<< (const void *&msg) |
| Append the address of a void pointer to the log. | |
| virtual bool | logWithLevel (const std::string &p_msg, const int &p_messageLevel) const |
| Log a message with a given message level if message level is greater of equal to the logger level then it will be printed. | |
| virtual FMTSolverLogger * | getSolverLogger () |
| Return the abstract logger used by the OSI solver interface. | |
| virtual std::unique_ptr< FMTLogger > | Clone () const =0 |
| clone the FMTLogger | |
Protected Member Functions | |
| virtual void | _cout (const char *message) const |
| Output a message, sometimes needed on Windows with boost::python to print directly into the Python window. | |
| virtual void | _setLoggingLevel (const int &level) |
| Set the solver logger logging level. | |
Protected Attributes | |
| std::unique_ptr< FMTSolverLogger > | m_solverref |
| std::string | m_filepath |
| string path the the potential filestream | |
| std::unique_ptr< std::ofstream > | m_FileStream |
| stream if the logger redirect the logging into somesort of file. | |
| boost::recursive_mutex | m_mtx |
| Mutex for multi-threading. | |
| bool | m_flushstream |
| If true will flush stream at each write. | |
Friends | |
| class | boost::serialization::access |
Base class handling the level of information printed by FMT.
When FMT is compiled with the OSI solver interface this class derives from CoinMessageHandler to help handle the log level of the solvers.
| Logging::FMTLogger::FMTLogger | ( | ) |
Default constructor for FMTLogger.
|
virtual |
Default destructor for FMTLogger.
| Logging::FMTLogger::FMTLogger | ( | const FMTLogger & | rhs | ) |
|
protectedvirtual |
Output a message, sometimes needed on Windows with boost::python to print directly into the Python window.
| [in] | message | the message to output. |
Reimplemented in Logging::FMTExcelLogger, and Logging::FMTQuietLogger.
|
protectedvirtual |
Set the solver logger logging level.
| [in] | level | the logging level to set. |
|
virtual |
Check the severity of the message to be printed by the CoinMessageHandler base class.
Reimplemented in Logging::FMTDebugLogger, Logging::FMTDefaultLogger, Logging::FMTQuietLogger, and Logging::FMTTaskLogger.
|
pure virtual |
Clone the logger, needed for the abstract CoinMessageHandler usage.
Implemented in Logging::FMTExcelLogger, Logging::FMTDebugLogger, Logging::FMTDefaultLogger, Logging::FMTQuietLogger, and Logging::FMTTaskLogger.
|
pure virtual |
clone the FMTLogger
Implemented in Logging::FMTDebugLogger, Logging::FMTDefaultLogger, Logging::FMTExcelLogger, Logging::FMTQuietLogger, and Logging::FMTTaskLogger.
| void Logging::FMTLogger::closeFileStream | ( | ) |
Close the file stream.
|
virtual |
Return the basic log stamp as a string.
|
virtual |
Return the abstract logger used by the OSI solver interface.
|
virtual |
Log information about the version of FMT and its build date.
|
virtual |
Log the actual time at which the function is called.
|
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.
| [in] | p_msg | the message |
| [in] | p_messageLevel | message level |
|
virtual |
Append a double to the log.
| [in] | msg | the a double to append. |
|
virtual |
Append a float to the log.
| [in] | msg | the a float to append. |
|
virtual |
Append an int to the log.
| [in] | msg | the an int to append. |
|
virtual |
Append a size_t to the log.
| [in] | msg | the a size_t to append. |
|
virtual |
Append a string to the log.
| [in] | msg | the a string to append. |
|
virtual |
Append a std::time_t to the log.
| [in] | msg | the a std::time_t to append. |
|
virtual |
Append an unsigned int to the log.
| [in] | msg | the an unsigned int to append. |
|
virtual |
Append the address of a void pointer to the log.
| [in] | msg | the void pointer whose address is appended. |
|
virtual |
Print function overloaded from CoinMessageHandler when using the OSI solver interface.
Reimplemented in Logging::FMTDebugLogger, Logging::FMTDefaultLogger, Logging::FMTQuietLogger, and Logging::FMTTaskLogger.
| void Logging::FMTLogger::redirectToFile | ( | const std::string & | filename, |
| bool | logStamp = true |
||
| ) |
Redirect the log information to a file.
| [in] | filename | the file to redirect the log to. |
| [in] | logStamp | if true writes a log stamp. |
| void Logging::FMTLogger::setStreamFlush | ( | bool | flush | ) |
Force the flushing of the file stream.
| [in] | flush | if true flushes the stream at each write. |
|
friend |
|
protected |
string path the the potential filestream
|
mutableprotected |
stream if the logger redirect the logging into somesort of file.
|
protected |
If true will flush stream at each write.
|
mutableprotected |
Mutex for multi-threading.
|
protected |