#include <stdio.h>#include <string>#include "TError.h"Go to the source code of this file.
Functions | |
| void | SyslogTErrorHandler (int level, Bool_t abort, const char *location, const char *msg) |
|
||||||||||||||||||||
|
Definition at line 22 of file SyslogTErrorHandler.cxx. References gSystem(). 00024 {
00025 // This error handler function sends the messages to syslog and
00026 // if abort is set it aborts the application.
00027
00028 if (level < gErrorIgnoreLevel)
00029 return;
00030
00031 const char *type = 0;
00032 int priority = LOG_DEBUG;
00033
00034 if (level >= kInfo)
00035 { type = "Info"; priority = LOG_INFO; }
00036 if (level >= kWarning)
00037 { type = "Warning"; priority = LOG_WARNING; }
00038 if (level >= kError)
00039 { type = "Error"; priority = LOG_ERR; }
00040 if (level >= kSysError)
00041 { type = "SysError"; priority = LOG_CRIT; }
00042 if (level >= kFatal)
00043 { type = "Fatal"; priority = LOG_ALERT; }
00044
00045 if (!location || strlen(location) == 0)
00046 syslog(priority, "<%c> %s: %s\n", type[0], type, msg);
00047 else
00048 syslog(priority, "<%c> %s in <%s>: %s\n", type[0], type, location, msg);
00049
00050 if (abort) {
00051 syslog(priority, "<%c> aborting\n",type[0]);
00052 if (gSystem) {
00053 gSystem->StackTrace();
00054 gSystem->Abort();
00055 } else
00056 ::abort();
00057 }
00058 }
|
1.3.9.1