.ide Logger sub classes are now generated with macro instead of plain code.

git-svn-id: svn://ultimatepp.org/upp/trunk@11006 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
klugier 2017-04-16 11:20:49 +00:00
parent c8e26390a2
commit bcae703a02

View file

@ -43,33 +43,20 @@ private:
Stream& operator<<(Stream& s, Logger::LoggingLevel level);
class LoggerDebug final : public Logger {
public:
LoggerDebug(const String& tag = "")
: Logger(Logger::LoggingLevel::DEBUG, tag)
{}
#define LOGGER(CLASS_NAME, LEVEL) \
class CLASS_NAME : public Logger { \
public: \
CLASS_NAME(const String& tag = "") \
: Logger(LEVEL, tag) \
{} \
};
class LoggerInfo final : public Logger {
public:
LoggerInfo(const String& tag = "")
: Logger(Logger::LoggingLevel::INFO, tag)
{}
};
LOGGER(LoggerDebug, Logger::LoggingLevel::DEBUG)
LOGGER(LoggerInfo, Logger::LoggingLevel::INFO)
LOGGER(LoggerWarn, Logger::LoggingLevel::WARN)
LOGGER(LoggerError, Logger::LoggingLevel::ERROR)
class LoggerWarn final : public Logger {
public:
LoggerWarn(const String& tag = "")
: Logger(Logger::LoggingLevel::WARN, tag)
{}
};
class LoggerError final : public Logger {
public:
LoggerError(const String& tag = "")
: Logger(Logger::LoggingLevel::ERROR, tag)
{}
};
#undef LOGGER
}