8#ifndef FMTlogger_Hm_included
9#define FMTlogger_Hm_included
10#include <boost/serialization/export.hpp>
11#include <boost/thread/recursive_mutex.hpp>
19 namespace serialization
29 class FMTSolverLogger;
179 virtual bool logWithLevel(
const std::string& p_msg,
const int& p_messageLevel)
const;
193 virtual std::unique_ptr <FMTLogger>
Clone()
const = 0;
195 #if defined FMTWITHOSI
207 mutable boost::recursive_mutex
m_mtx;
216 virtual void _cout(
const char* message)
const;
226 friend class boost::serialization::access;
234 template<
class Archive>
235 void save(Archive& ar,
const unsigned int version)
const;
243 template<
class Archive>
244 void load(Archive& ar,
const unsigned int version);
252 template<
class Archive>
253 void serialize(Archive& ar,
const unsigned int file_version);
259 void _setToFile(
const std::string& filename)
const;
#define FMTEXPORT
Definition: FMTutility.h:125
Base class handling the level of information printed by FMT.
Definition: FMTLogger.h:37
virtual int print()
Print function overloaded from CoinMessageHandler when using the OSI solver interface.
virtual FMTLogger & operator<<(const float &msg)
Append a float 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.
FMTLogger()
Default constructor for FMTLogger.
virtual void checkSeverity()
Check the severity of the message to be printed by the CoinMessageHandler base class.
virtual FMTLogger & operator<<(const unsigned int &msg)
Append an unsigned int to the log.
virtual ~FMTLogger()
Default destructor for FMTLogger.
virtual void _setLoggingLevel(const int &level)
Set the solver logger logging level.
bool m_flushstream
If true will flush stream at each write.
Definition: FMTLogger.h:210
virtual std::string getLogStamp() const
Return the basic log stamp as a string.
std::string m_filepath
string path the the potential filestream
Definition: FMTLogger.h:200
virtual std::unique_ptr< FMTLogger > Clone() const =0
clone the FMTLogger
virtual FMTLogger & operator<<(const std::time_t &msg)
Append a std::time_t to the log.
virtual void logStamp()
Log information about the version of FMT and its build date.
virtual FMTSolverLogger * getSolverLogger()
Return the abstract logger used by the OSI solver interface.
virtual FMTLogger & operator<<(const size_t &msg)
Append a size_t to the log.
virtual FMTLogger & operator<<(const std::string &msg)
Append a string to the log.
void setStreamFlush(bool flush)
Force the flushing of the file stream.
virtual FMTLogger & operator<<(const void *&msg)
Append the address of a void pointer to the log.
void redirectToFile(const std::string &filename, bool logStamp=true)
Redirect the log information to a file.
virtual FMTLogger * clone() const =0
Clone the logger, needed for the abstract CoinMessageHandler usage.
std::unique_ptr< std::ofstream > m_FileStream
stream if the logger redirect the logging into somesort of file.
Definition: FMTLogger.h:203
void closeFileStream()
Close the file stream.
FMTLogger(const FMTLogger &rhs)
Copy constructor for FMTLogger.
virtual void _cout(const char *message) const
Output a message, sometimes needed on Windows with boost::python to print directly into the Python wi...
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 the...
boost::recursive_mutex m_mtx
Mutex for multi-threading.
Definition: FMTLogger.h:207
virtual void logTime()
Log the actual time at which the function is called.
std::unique_ptr< FMTSolverLogger > m_solverref
Definition: FMTLogger.h:196
Abstract logger used with the OSI solver interface (CoinMessageHandler).
Definition: FMTSolverLogger.h:25
Namespace for the log management, provides different log handlers.
Definition: FMTDebugLogger.h:14
Definition: FMTAction.h:463