31static const char *__crashreporter_info__ = 0;
32asm(
".desc ___crashreporter_info__, 0x10");
39 static std::mutex *
m =
new std::mutex();
59 TTHREAD_TLS(
Int_t) buf_size = 2048;
60 TTHREAD_TLS(
char*) buf =
nullptr;
67 buf =
new char[buf_size];
69 Int_t n = vsnprintf(buf, buf_size, fmt, ap);
72 if (
n == -1 ||
n >= buf_size) {
88 const char *toprint = buf;
89 fprintf(stderr,
"%s", toprint);
92 ::OutputDebugString(buf);
107 auto cstrlevel =
gEnv->GetValue(
"Root.ErrorIgnoreLevel",
"Print");
113 while (cstrlevel && *cstrlevel) {
114 slevel.push_back(tolower(*cstrlevel));
118 if (slevel ==
"print")
120 else if (slevel ==
"info")
122 else if (slevel ==
"warning")
124 else if (slevel ==
"error")
126 else if (slevel ==
"break")
128 else if (slevel ==
"syserror")
130 else if (slevel ==
"fatal")
138 const char *type =
"?";
147 type =
"\n *** Break ***";
157 smsg = std::string(type) +
" " + msg;
158 else if (!location || !location[0])
159 smsg = std::string(type) +
": " + msg;
161 smsg = std::string(type) +
" in <" + location +
">: " + msg;
169 if (__crashreporter_info__)
170 delete [] __crashreporter_info__;
171 __crashreporter_info__ = strdup(smsg.c_str());
int Int_t
Signed integer 4 bytes (int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
static void DebugPrint(const char *fmt,...)
Print debugging message to stderr and, on Windows, to the system debugger.
void DefaultErrorHandler(Int_t level, Bool_t abort_bool, const char *location, const char *msg)
The default error handler function.
static std::mutex * GetErrorMutex()
Serializes error output, destructed by the gROOT destructor via ReleaseDefaultErrorHandler().
constexpr Int_t kSysError
externInt_t gErrorIgnoreLevel
errors with level below this value will be ignored. Default is kUnset.
void ReleaseDefaultErrorHandler()
Destructs resources that are taken by using the default error handler.