1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-12 10:03:53 +02:00
vcmi/include/vstd/CLoggerBase.h
2016-08-13 16:57:16 +03:00

62 lines
1.0 KiB
C++

/*
* CLoggerBase.h, part of VCMI engine
*
* Authors: listed in file AUTHORS in main folder
*
* License: GNU General Public License v2.0 or later
* Full text of license available in license.txt file, in main folder
*
*/
#pragma once
namespace ELogLevel
{
enum ELogLevel
{
NOT_SET = 0,
TRACE,
DEBUG,
INFO,
WARN,
ERROR
};
}
namespace vstd
{
class DLL_LINKAGE CLoggerBase
{
public:
virtual ~CLoggerBase(){};
virtual void log(ELogLevel::ELogLevel level, const std::string & message) const = 0;
/// Log methods for various log levels
inline void trace(const std::string & message) const
{
log(ELogLevel::TRACE, message);
};
inline void debug(const std::string & message) const
{
log(ELogLevel::DEBUG, message);
};
inline void info(const std::string & message) const
{
log(ELogLevel::INFO, message);
};
inline void warn(const std::string & message) const
{
log(ELogLevel::WARN, message);
};
inline void error(const std::string & message) const
{
log(ELogLevel::ERROR, message);
};
};
}