#include "base/types.hh"
#include "sim/core.hh"
-
-Logger &
-Logger::get(LogLevel ll)
-{
- static std::array<Logger *, NUM_LOG_LEVELS> loggers{{
- new ExitLogger(std::cerr, "panic"),
- new ExitLogger(std::cerr, "fatal"),
- new Logger(std::cerr, "warn"),
- new Logger(std::cerr, "info"),
- new Logger(std::cerr, "hack"),
- }};
-
- return *loggers[ll];
-}
-
void
Logger::setLevel(LogLevel ll)
{
}
}
+class ExitLogger : public Logger
+{
+ public:
+ using Logger::Logger;
+
+ void printEpilogue(const char *func, const char *file, int line,
+ const char *format) override;
+};
+
void
ExitLogger::printEpilogue(const char *func, const char *file, int line,
const char *format)
ccprintf(stream, "Memory Usage: %ld KBytes\n", memUsage());
}
+
+Logger &
+Logger::get(LogLevel ll)
+{
+ static std::array<Logger *, NUM_LOG_LEVELS> loggers{{
+ new ExitLogger(std::cerr, "panic"),
+ new ExitLogger(std::cerr, "fatal"),
+ new Logger(std::cerr, "warn"),
+ new Logger(std::cerr, "info"),
+ new Logger(std::cerr, "hack"),
+ }};
+
+ return *loggers[ll];
+}
const char *prefix;
};
-class ExitLogger : public Logger
-{
- public:
- using Logger::Logger;
-
- void printEpilogue(const char *func, const char *file, int line,
- const char *format) override;
-};
-
#define exit_message(logger, code, ...) \
do { \
logger.print(__FUNCTION__, __FILE__, __LINE__, __VA_ARGS__); \