50 bool hasLogged =
false;
51 std::string lastMessage;
52 std::string lastModule;
53 auto tmpLogger = [&](std::string module, std::string msg,
Flusher doFlush)
73 assertOrDie(lastMessage ==
"Mweh. x = 3",
"Substitution gone wrong!");
80 assertOrDie(lastMessage ==
"Escapes are possible! 100.01% sure!",
"Escape gone wrong!");
84 assertOrDie(lastModule ==
"UnitTester",
"Module was incorrect!");
86 assertOrDie(lastModule !=
"UnitTester",
"Module was incorrect!");
Logger< HG_LOGLEVEL_SELFTEST > unitLogger("UnitTester")
void assertOrDie(bool condition, std::string message)
Definition: LoggerUnitTest.cpp:38
LL< Log::DEBUG > DEBUG
Debug information.
Definition: Logger.cc:58
LL< Log::FATAL > FATAL
Definition of the different loglevels by its wrapper class LL. These are used as tags in template met...
Definition: Logger.cc:52
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
LL< Log::ERROR > ERROR
Error log level.
Definition: Logger.cc:53
LoggerOutput * loggerOutput
Declaration of the output functions.
Definition: Logger.cc:283
LL< Log::WARN > WARN
Warning log level.
Definition: Logger.cc:54
Flusher
The Logger class provides ability to write log messages in your own customized format.
Definition: Logger.h:115
std::function< void(std::string, std::string, Flusher)> onVerbose
Definition: Logger.h:163
std::function< void(std::string, std::string, Flusher)> onFatal
Definition: Logger.h:159
std::function< void(std::string, std::string, Flusher)> onWarn
Definition: Logger.h:161
std::function< void(std::string, std::string, Flusher)> onError
Definition: Logger.h:160
std::function< void(std::string, std::string, Flusher)> onInfo
Definition: Logger.h:162
std::function< void(std::string, std::string, Flusher)> onDebug
Definition: Logger.h:164