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

Logger used by the Excel add-in that stores the output in a string instead of printing it. More...

#include <FMTExcelLogger.h>

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

Public Member Functions

 FMTExcelLogger ()
 Default constructor for FMTExcelLogger.
 
std::string getPrintOut () const
 Return the stored output.
 
void clearOut ()
 Clear the stored output.
 
virtual FMTLoggerclone () const
 Clone the FMTExcelLogger.
 
virtual std::unique_ptr< FMTLoggerClone () const
 Clone the FMTExcelLogger.
 
- Public Member Functions inherited from Logging::FMTLogger
 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.
 
FMTLoggeroperator= (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 FMTLoggerclone () 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 FMTLoggeroperator<< (const std::string &msg)
 Append a string to the log.
 
virtual FMTLoggeroperator<< (const int &msg)
 Append an int to the log.
 
virtual FMTLoggeroperator<< (const double &msg)
 Append a double to the log.
 
virtual FMTLoggeroperator<< (const float &msg)
 Append a float to the log.
 
virtual FMTLoggeroperator<< (const std::time_t &msg)
 Append a std::time_t to the log.
 
virtual FMTLoggeroperator<< (const size_t &msg)
 Append a size_t to the log.
 
virtual FMTLoggeroperator<< (const unsigned int &msg)
 Append an unsigned int to the log.
 
virtual FMTLoggeroperator<< (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 FMTSolverLoggergetSolverLogger ()
 Return the abstract logger used by the OSI solver interface.
 
virtual std::unique_ptr< FMTLoggerClone () const =0
 clone the FMTLogger
 

Protected Member Functions

void _cout (const char *message) const override
 Append a message to the stored output.
 
- Protected Member Functions inherited from Logging::FMTLogger
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.
 

Additional Inherited Members

- Protected Attributes inherited from Logging::FMTLogger
std::unique_ptr< FMTSolverLoggerm_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.
 

Detailed Description

Logger used by the Excel add-in that stores the output in a string instead of printing it.

Constructor & Destructor Documentation

◆ FMTExcelLogger()

Logging::FMTExcelLogger::FMTExcelLogger ( )

Default constructor for FMTExcelLogger.

Member Function Documentation

◆ _cout()

void Logging::FMTExcelLogger::_cout ( const char *  message) const
overrideprotectedvirtual

Append a message to the stored output.

Parameters
[in]messagethe message to append.

Reimplemented from Logging::FMTLogger.

◆ clearOut()

void Logging::FMTExcelLogger::clearOut ( )

Clear the stored output.

◆ clone()

virtual FMTLogger * Logging::FMTExcelLogger::clone ( ) const
virtual

Clone the FMTExcelLogger.

Returns
a pointer to the cloned logger.

Implements Logging::FMTLogger.

◆ Clone()

virtual std::unique_ptr< FMTLogger > Logging::FMTExcelLogger::Clone ( ) const
virtual

Clone the FMTExcelLogger.

Returns
a unique pointer to the cloned logger.

Implements Logging::FMTLogger.

◆ getPrintOut()

std::string Logging::FMTExcelLogger::getPrintOut ( ) const

Return the stored output.

Returns
the accumulated output string.

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