2017-08-08 13:53:47 +02:00
|
|
|
#ifndef _LOGGER_H
|
|
|
|
#define _LOGGER_H
|
|
|
|
|
|
|
|
#include <boost/log/trivial.hpp>
|
|
|
|
|
|
|
|
namespace Core {
|
|
|
|
|
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
enum struct LoggingSeverity :
|
|
|
|
uint8_t
|
|
|
|
{
|
|
|
|
trace = 0,
|
|
|
|
debug = 1,
|
|
|
|
info = 2,
|
|
|
|
warning = 3,
|
|
|
|
error = 4,
|
|
|
|
fatal = 5
|
|
|
|
};
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
class Logger
|
|
|
|
{
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
private:
|
|
|
|
boost::log::sources::severity_logger_mt< boost::log::trivial::severity_level > m_lg;
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
std::string m_logFile;
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
public:
|
|
|
|
Logger();
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
~Logger();
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
void init();
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
void Log( LoggingSeverity logSev, const std::string& text );
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
void error( const std::string& text );
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
void info( const std::string& text );
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
void debug( const std::string& text );
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
void fatal( const std::string& text );
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
void setLogPath( const std::string& logPath );
|
|
|
|
|
|
|
|
};
|
2017-08-08 13:53:47 +02:00
|
|
|
|
|
|
|
|
2018-08-29 21:40:59 +02:00
|
|
|
}
|
2017-08-08 13:53:47 +02:00
|
|
|
|
|
|
|
|
|
|
|
#endif
|