31 #ifndef HG_LOGLEVEL_SELFTEST
32 #define HG_LOGLEVEL_SELFTEST Log::DEFAULT
39 std::cerr <<
"Assert failed: " << message << std::endl;
46 bool hasLogged =
false;
47 std::string lastMessage;
48 std::string lastModule;
49 auto tmpLogger = [&](std::string module, std::string msg) {
68 assertOrDie(lastMessage ==
"Mweh. x = 3",
"Substitution gone wrong!");
75 assertOrDie(lastMessage ==
"Escapes are possible! 100.01% sure!",
"Escape gone wrong!");
79 assertOrDie(lastModule ==
"UnitTester",
"Module was incorrect!");
81 assertOrDie(lastModule !=
"UnitTester",
"Module was incorrect!");
LL< Log::DEBUG > DEBUG
Debug information.
std::function< void(std::string, std::string)> onWarn
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
std::function< void(std::string, std::string)> onVerbose
LL< Log::ERROR > ERROR
Error log level.
LL< Log::WARN > WARN
Warning log level.
std::function< void(std::string, std::string)> onError
void assertOrDie(bool condition, std::string message)
LL< Log::FATAL > FATAL
Fatal log level.
LoggerOutput * loggerOutput
Declaration of the output functions. If the output needs to be redirected, please swap the loggerOutp...
std::function< void(std::string, std::string)> onDebug
std::function< void(std::string, std::string)> onInfo
Logger< HG_LOGLEVEL_SELFTEST > unitLogger("UnitTester")
std::function< void(std::string, std::string)> onFatal