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

override StackWalker OnOutput to write to output using our logger util

This commit is contained in:
NotAdam 2019-03-27 17:58:11 +11:00
parent 82ecc83951
commit 482eea8fd1

View file

@ -8,8 +8,20 @@
#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 )
{
Logger::critical( szText );
}
};
#endif #endif
using namespace Sapphire::Common; using namespace Sapphire::Common;
Util::CrashHandler::CrashHandler() Util::CrashHandler::CrashHandler()
@ -137,7 +149,7 @@ void Util::CrashHandler::printStackTrace( unsigned int max_frames )
#else #else
StackWalker sw; SapphireStackWalker sw;
sw.ShowCallstack(); sw.ShowCallstack();
#endif #endif