31#include <unordered_set>
33#include "gamslib_global.h"
43 mTargets.insert(mTargets.end(), (target ? target : stdout));
46 std::unordered_set<FILE*> mTargets;
70 if (mBinds.find(logId) == mBinds.end())
71 return std::unordered_set<FILE*>();
72 TargetSet lc = mBinds.at(logId);
73 if (lc.mDebug <
debug)
74 return std::unordered_set<FILE*>();
82 if (mBinds.count(logId) > 0)
83 return mBinds.at(logId).mDebug;
90 std::map<LogId, TargetSet> mBinds;
92 LoggerPool(LoggerPool
const&) {}
93 void operator=(LoggerPool
const&) {}
106 : mBufferStream(mBuffer), mWhere(where), mTargets(
LoggerPool::instance().targets(logID, debug))
115 std::stringstream strStream;
117 mBufferStream << strStream.str().c_str();
124 mBufferStream << value.c_str();
132 mBufferStream << value;
138 std::stringstream mBufferStream;
140 std::unordered_set<FILE*> mTargets;
145#define DEB_S(logID) ::gams::Logger(logID, ::gams::GAMSEnum::DebugLevel::Verbose, __FUNCTION__)
146#define DEB ::gams::Logger(logID(), ::gams::GAMSEnum::DebugLevel::Verbose, __FUNCTION__)
147#define MSG ::gams::Logger(logID(), ::gams::GAMSEnum::DebugLevel::ShowLog, __FUNCTION__)
148#define ERR ::gams::Logger(logID(), ::gams::GAMSEnum::DebugLevel::Off, __FUNCTION__)
DebugLevel
GAMS Debug Level.
@ Verbose
Send highly technical info and GAMS log to stdout and keep temporary file.
The class to manage all loggers used in an API instance.
static LoggerPool & instance()
GAMSEnum::DebugLevel debug(const LogId logId) const
void registerLogger(const LogId logId, const GAMSEnum::DebugLevel debug, FILE *target=stdout)
void unregisterLogger(const LogId logId)
std::unordered_set< FILE * > targets(const LogId logId, const GAMSEnum::DebugLevel debug) const
Logging class used to get feedback about the API actions.
Logger(const LogId logID, const GAMSEnum::DebugLevel debug, const char *where)
Logger & operator<<(std::ostream &(*os)(std::ostream &))