polserver/pol-core/clib/Debugging/ExceptionParser.h

66 lines
1.6 KiB
C
Raw Permalink Normal View History

2015-04-09 14:01:54 +02:00
#ifndef CLIB_EXCEPTION_PARSER_H
#define CLIB_EXCEPTION_PARSER_H
2014-11-01 22:59:09 +01:00
#include <string>
2014-11-01 22:59:09 +01:00
namespace Pol
{
namespace Clib
{
2014-11-01 22:59:09 +01:00
class ExceptionParser
{
public:
ExceptionParser();
virtual ~ExceptionParser();
/**
* @brief Returns a string containing the current stack trace
* @return the stack trace as multi-line string
*/
static std::string getTrace();
/**
* @brief Reports a program abort to the program devs
* @param stackTrace the stack trace of the abort
* @param reason a descriptive text about the reason for the abort
*/
2016-12-15 16:59:58 +01:00
static void reportProgramAbort( const std::string& stackTrace, const std::string& reason );
/**
* @brief Logs stack traces of all threads to stdout and error output
*/
static void logAllStackTraces();
/**
* @brief Initiates globally the exception catching (signal handlers for Linux)
*/
static void initGlobalExceptionCatching();
/**
* @brief Configures the bug reporting system
*/
static void configureProgramAbortReportingSystem( bool active, std::string server,
std::string url, std::string reporter );
/**
* @brief Returns true if the bug reporting is active
*/
static bool programAbortReporting();
/**
* @brief Handles exceptions
*/
static void handleExceptionSignal( int signal );
private:
static bool m_programAbortReporting;
static std::string m_programAbortReportingServer;
static std::string m_programAbortReportingUrl;
static std::string m_programAbortReportingReporter;
static std::string m_programStart;
2014-11-01 22:59:09 +01:00
};
}
} // namespaces
2014-11-01 22:59:09 +01:00
#endif