30#include <unordered_set>
32#include "gamslib_global.h"
42 mTargets.insert(mTargets.end(), (target ? target : stdout));
45 std::unordered_set<FILE*> mTargets;
69 if (mBinds.find(logId) == mBinds.end())
70 return std::unordered_set<FILE*>();
71 TargetSet lc = mBinds.at(logId);
72 if (lc.mDebug <
debug)
73 return std::unordered_set<FILE*>();
81 if (mBinds.count(logId) > 0)
82 return mBinds.at(logId).mDebug;
89 std::map<LogId, TargetSet> mBinds;
91 LoggerPool(LoggerPool
const&) {}
92 void operator=(LoggerPool
const&) {}
105 : mBufferStream(mBuffer), mWhere(where), mTargets(
LoggerPool::instance().targets(logID, debug))
114 std::stringstream strStream;
116 mBufferStream << strStream.str().c_str();
123 mBufferStream << value.c_str();
131 mBufferStream << value;
137 std::stringstream mBufferStream;
139 std::unordered_set<FILE*> mTargets;
144#define DEB_S(logID) ::gams::Logger(logID, ::gams::GAMSEnum::DebugLevel::Verbose, __FUNCTION__)
145#define DEB ::gams::Logger(logID(), ::gams::GAMSEnum::DebugLevel::Verbose, __FUNCTION__)
146#define MSG ::gams::Logger(logID(), ::gams::GAMSEnum::DebugLevel::ShowLog, __FUNCTION__)
147#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 &))