1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-28 23:27:45 +00:00

Merge branch 'develop' of https://github.com/SapphireMordred/Sapphire into develop

This commit is contained in:
Mordred 2019-03-27 18:03:56 +01:00
commit e0537e2d45
3 changed files with 16 additions and 13 deletions

View file

@ -1,5 +1,7 @@
#include "Logger.h"
#define SPDLOG_LEVEL_NAMES { "trace", "debug", "info", "warning", "error", "fatal", "off" }
#include <spdlog/spdlog.h>
#include <spdlog/async.h>
#include <spdlog/sinks/stdout_color_sinks.h>
@ -10,16 +12,6 @@
namespace fs = std::experimental::filesystem;
Sapphire::Logger::Logger()
{
}
Sapphire::Logger::~Logger()
{
}
void Sapphire::Logger::init( const std::string& logPath )
{
auto pos = logPath.find_last_of( fs::path::preferred_separator );

View file

@ -13,8 +13,8 @@ namespace Sapphire
private:
std::string m_logFile;
Logger();
~Logger();
Logger() = default;
~Logger() = default;
public:

View file

@ -8,6 +8,17 @@
#include <cxxabi.h>
#else
#include <stackwalker/StackWalker.h>
class SapphireStackWalker : public StackWalker
{
public:
SapphireStackWalker() : StackWalker() {}
protected:
virtual void OnOutput( LPCSTR szText )
{
Sapphire::Logger::fatal( "{}", szText );
}
};
#endif
using namespace Sapphire::Common;
@ -137,7 +148,7 @@ void Util::CrashHandler::printStackTrace( unsigned int max_frames )
#else
StackWalker sw;
SapphireStackWalker sw;
sw.ShowCallstack();
#endif