mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-06-13 22:04:36 -06:00
.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:
parent
c8e26390a2
commit
bcae703a02
1 changed files with 11 additions and 24 deletions
|
|
@ -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
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue