MercuryDPM
Beta
|
#include <Logger.h>
Public Member Functions | |
Logger (const std::string name) | |
constructor More... | |
~Logger () | |
destructor More... | |
template<Log LOGLEVEL, typename... Args> | |
std::enable_if<!((L< LOGLEVEL)||(MERCURY_LOGLEVEL < LOGLEVEL)), void >::type | operator() (const LL< LOGLEVEL > log UNUSED, const std::string &format, Args &&...arg) |
template<Log LOGLEVEL, typename... Args> | |
std::enable_if< L< LOGLEVEL||MERCURY_LOGLEVEL < LOGLEVEL, void >::type operator()(const LL< LOGLEVEL > log UNUSED, const std::string &format UNUSED, Args &&...arg UNUSED){}template< Log LOGLEVEL, typename...Args > typename std::enable_if<!((L < LOGLEVEL)||(MERCURY_LOGLEVEL < LOGLEVEL)), void >::type operator()(const LL< LOGLEVEL > log UNUSED, const char *format, Args &&...arg){std::stringstream msgstream;createMessage(msgstream, format, arg...);if(LOGLEVEL <=Log::FATAL){loggerOutput-> onFatal(module, msgstream.str());}else if(LOGLEVEL<=Log::ERROR){loggerOutput-> | onError (module, msgstream.str()) |
else | if (LOGLEVEL<=Log::WARN) |
else | if (LOGLEVEL<=Log::INFO) |
else | if (LOGLEVEL<=Log::VERBOSE) |
template<Log LOGLEVEL, typename... Args> | |
std::enable_if< L< LOGLEVEL||MERCURY_LOGLEVEL < LOGLEVEL, void >::type operator()(const LL< LOGLEVEL > log UNUSED, const char *format UNUSED, Args &&...arg UNUSED){}template < typename...Args > void log(const Log loglevel, const std::string &format, Args &&...arg){if(loglevel<=L||loglevel <=MERCURY_LOGLEVEL){std::stringstream msgstream;createMessage(msgstream, format.c_str(), arg...);if(loglevel <=Log::FATAL){loggerOutput-> onFatal(module, msgstream.str());}else if(loglevel<=Log::ERROR){loggerOutput-> | onError (module, msgstream.str()) |
else | if (loglevel<=Log::WARN) |
else | if (loglevel<=Log::INFO) |
else | if (loglevel<=Log::VERBOSE) |
Public Attributes | |
else | |
Private Member Functions | |
template<typename Arg1 , typename... Args> | |
void | createMessage (std::stringstream &msg, const char *fmt, Arg1 &&arg, Args &&...args) |
Actual implementation to recursively replace all the '' signs by actual values. More... | |
template<typename Arg1 > | |
void | createMessage (std::stringstream &msg, const char *fmt, Arg1 &&arg) |
Terminating case / argument call. More... | |
void | createMessage (std::stringstream &msg, const char *message) |
Terminating case / no argument call. More... | |
Private Attributes | |
const std::string | module |
The module name of this actual logger. More... | |
Usage: logger(FATAL, "Error in (here) because % < %!\n", var1, var2);
Define custom loggers by: #ifndef HG_LOGLEVEL_CUSTOMMOD #define HG_LOGLEVEL_CUSTOMMOD Log::Debug #endif Logger<HG_LOGLEVEL_CUSTOMMOD> customLogger;
constructor
Definition at line 285 of file Logger.h.
|
inlineprivate |
Actual implementation to recursively replace all the '' signs by actual values.
Definition at line 387 of file Logger.h.
Referenced by Logger< L >::operator()().
|
inlineprivate |
|
inlineprivate |
Definition at line 339 of file Logger.h.
Definition at line 341 of file Logger.h.
|
inline |
Definition at line 343 of file Logger.h.
Definition at line 370 of file Logger.h.
Definition at line 372 of file Logger.h.
|
inline |
Definition at line 374 of file Logger.h.
std::enable_if<L < LOGLEVEL || MERCURY_LOGLEVEL < LOGLEVEL, void>::type operator()(const LL<LOGLEVEL> log UNUSED, const std::string& format UNUSED, Args&&... arg UNUSED) { } template<Log LOGLEVEL, typename... Args> typename std::enable_if<!((L < LOGLEVEL) || (MERCURY_LOGLEVEL < LOGLEVEL)), void>::type operator()(const LL<LOGLEVEL> log UNUSED, const char * format, Args&&... arg) { std::stringstream msgstream; createMessage(msgstream, format, arg...); if (LOGLEVEL <= Log::FATAL) { loggerOutput->onFatal(module, msgstream.str()); } else if (LOGLEVEL <= Log::ERROR) { loggerOutput-> Logger< L >::onError | ( | module | , |
msgstream. | str() | ||
) |
std::enable_if<L < LOGLEVEL || MERCURY_LOGLEVEL < LOGLEVEL, void>::type operator()(const LL<LOGLEVEL> log UNUSED, const char * format UNUSED, Args&&... arg UNUSED) { } template<typename... Args> void log(const Log loglevel, const std::string& format, Args&&... arg) { if (loglevel <= L || loglevel <= MERCURY_LOGLEVEL) { std::stringstream msgstream; createMessage(msgstream, format.c_str(), arg...); if (loglevel <= Log::FATAL) { loggerOutput->onFatal(module, msgstream.str()); } else if (loglevel <= Log::ERROR) { loggerOutput-> Logger< L >::onError | ( | module | , |
msgstream. | str() | ||
) |
|
inline |
Definition at line 306 of file Logger.h.
References Logger< L >::createMessage(), ERROR, FATAL, INFO, Logger< L >::module, LoggerOutput::onDebug, LoggerOutput::onError, LoggerOutput::onFatal, LoggerOutput::onInfo, LoggerOutput::onVerbose, LoggerOutput::onWarn, VERBOSE, and WARN.
Logger< L >::else |
|
private |
The module name of this actual logger.
Definition at line 277 of file Logger.h.
Referenced by Logger< L >::operator()().