1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-29 07:37: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" #include "Logger.h"
#define SPDLOG_LEVEL_NAMES { "trace", "debug", "info", "warning", "error", "fatal", "off" }
#include <spdlog/spdlog.h> #include <spdlog/spdlog.h>
#include <spdlog/async.h> #include <spdlog/async.h>
#include <spdlog/sinks/stdout_color_sinks.h> #include <spdlog/sinks/stdout_color_sinks.h>
@ -10,16 +12,6 @@
namespace fs = std::experimental::filesystem; namespace fs = std::experimental::filesystem;
Sapphire::Logger::Logger()
{
}
Sapphire::Logger::~Logger()
{
}
void Sapphire::Logger::init( const std::string& logPath ) void Sapphire::Logger::init( const std::string& logPath )
{ {
auto pos = logPath.find_last_of( fs::path::preferred_separator ); auto pos = logPath.find_last_of( fs::path::preferred_separator );

View file

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

View file

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