Make a HadronZoo fatal error report using the supplied hzChain (as error message) and place it both in the logfile for the thread and to stderr Returns: None
| Return Type | Function name | Arguments |
|---|---|---|
| void | Fatal | (hzChain&,) |
Declared in file: hzProcess.h
Defined in file : hzError.cpp
Function Logic:
Function body:
void Fatal (hzChain& error)
{
// Category: Diagnostics
//
// Make a HadronZoo fatal error report using the supplied hzChain (as error message) and place it both in the logfile for the thread and to stderr
//
// Arguments: 1) error The error message as chain
//
// Returns: None
hzChain E ; // Error chain
hzXDate d ; // System full date
hzLogger* pLog ; // Output logfile
hzProcess* phz ; // Process controller
if (_hzGlobal_kill)
return ;
// Get log channel and current date & time
phz = GetThreadInfo() ;
_hzGlobal_kill = true ;
d.SysDateTime() ;
// Populate the errmsg chain
E.Printf("Fatal Error in process %05u (tid %u) at %04d%02d%02d-%02d%02d%02d -> ",
getpid(), pthread_self(), d.Year(), d.Month(), d.Day(), d.Hour(), d.Min(), d.Sec()) ;
E << error ;
// Output the message - deal with case where no logger is found for the current thread or the logger is closed or non-verbose (demon)
pLog = GetThreadLogger() ;
if (!pLog)
std::cerr << E ;
else
{
if (pLog->IsOpen())
pLog->Out(E) ;
else
std::cerr << E ;
}
phz->StackTrace() ;
exit(0);
}