game2006/server/gameserver/tracemgr.cc
aozhiwei 1fc55be04f 1
2024-05-17 18:01:43 +08:00

43 lines
631 B
C++

#include "precompile.h"
#include <iostream>
#include "tracemgr.h"
#ifdef MYDEBUG
#define BOOST_STACKTRACE_USE_ADDR2LINE
#include <boost/stacktrace.hpp>
void TraceMgr::Init(const std::string& filename)
{
filename_ = filename;
log_file_ = fopen("backtrace.log", "w");
if (!log_file_) {
A8_ABORT();
}
PrintBackTrace();
}
void TraceMgr::UnInit()
{
if (log_file_) {
fclose(log_file_);
log_file_ = nullptr;
}
}
void TraceMgr::Trace(const std::string& hint)
{
}
void TraceMgr::PrintBackTrace()
{
#if 0
std::cout << boost::stacktrace::stacktrace();
#endif
}
#endif