1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-25 14:07:46 +00:00
sapphire/src/common/Logging/Logger.h

53 lines
700 B
C
Raw Normal View History

2017-08-08 13:53:47 +02:00
#ifndef _LOGGER_H
#define _LOGGER_H
#include <boost/log/trivial.hpp>
namespace Core {
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
class Logger
{
2017-08-08 13:53:47 +02:00
private:
boost::log::sources::severity_logger_mt< boost::log::trivial::severity_level > m_lg;
2017-08-08 13:53:47 +02:00
std::string m_logFile;
2017-08-08 13:53:47 +02:00
public:
Logger();
2017-08-08 13:53:47 +02:00
~Logger();
2017-08-08 13:53:47 +02:00
void init();
2017-08-08 13:53:47 +02:00
void Log( LoggingSeverity logSev, const std::string& text );
2017-08-08 13:53:47 +02:00
void error( const std::string& text );
2017-08-08 13:53:47 +02:00
void info( const std::string& text );
2017-08-08 13:53:47 +02:00
void debug( const std::string& text );
2017-08-08 13:53:47 +02:00
void fatal( const std::string& text );
2017-08-08 13:53:47 +02:00
void setLogPath( const std::string& logPath );
};
2017-08-08 13:53:47 +02:00
}
2017-08-08 13:53:47 +02:00
#endif