30 fLogScreenLevel(
INFO),
33 fBufferSizeNeeded(-1),
34 fDynamicBuffer(fBufferSize),
35 fBufferPointer(&fDynamicBuffer[0]),
38 fScreenStream(&std::cout),
40 fNullStream(new std::ostream(0)),
60 const char* format, ...)
64 Log(
FATAL, file, line, func, format, ap);
69 const char* format, ...)
74 Log(
ERROR, file, line, func, format, ap);
80 const char* format, ...)
91 const char* format, ...)
96 Log(
INFO, file, line, func, format, ap);
102 const char* format, ...)
106 va_start(ap, format);
107 Log(
DEBUG, file, line, func, format, ap);
113 const char* format, ...)
117 va_start(ap, format);
118 Log(
DEBUG1, file, line, func, format, ap);
124 const char* format, ...)
128 va_start(ap, format);
129 Log(
DEBUG2, file, line, func, format, ap);
135 const char* format, ...)
139 va_start(ap, format);
140 Log(
DEBUG3, file, line, func, format, ap);
146 const char* format, ...)
150 va_start(ap, format);
151 Log(
DEBUG4, file, line, func, format, ap);
157 const char*
func,
const char* format, va_list arglist)
216 dynamic_cast<std::ofstream*
>(
fFileStream)->close();
224 if (logfile.IsNull()) {
225 Int_t
PID = gSystem->GetPid();
226 logfile =
"FairLogfile_";
235 if (!logfile.Contains(
'/')) {
236 logfile =
"./" + logfile;
255 TString level = levelc;
257 if (level ==
"FATAL") {
return FATAL; }
258 if (level ==
"ERROR") {
return ERROR; }
259 if (level ==
"WARNING") {
return WARNING; }
260 if (level ==
"INFO") {
return INFO; }
261 if (level ==
"DEBUG") {
return DEBUG; }
262 if (level ==
"DEBUG1") {
return DEBUG1; }
263 if (level ==
"DEBUG2") {
return DEBUG2; }
264 if (level ==
"DEBUG3") {
return DEBUG3; }
265 if (level ==
"DEBUG4") {
return DEBUG4; }
275 TString vlevel = vlevelc;
290 timeinfo = localtime(&rawtime);
292 strftime(
fTimeBuffer, 80,
"[%d.%m.%Y %X] ", timeinfo);
313 if (level ==
FATAL) {
336 Ssiz_t
pos = bla.Last(
'/');
337 TString
s2(bla(pos+1, bla.Length()));
338 TString
s3 = s2 +
"::" + func +
":" + line;
357 Ssiz_t
pos = bla.Last(
'/');
358 TString
s2(bla(pos+1, bla.Length()));
359 TString
s3 = s2 +
"::" + func +
":" + line;
449 *
fScreenStream <<
"We stop the execution of the process at this point.\n";
452 *
fFileStream <<
"[" << std::setw(7) << std::left << LogLevelString[
FATAL] <<
"] ";
455 *
fFileStream <<
"We stop the execution of the process at this point.\n";
459 TString corefile =
"core_dump_";
460 Int_t
PID = gSystem->GetPid();
471 *
fScreenStream <<
"For later analysis we write a core dump to " <<
476 *
fFileStream <<
"[" << std::setw(7) << std::left << LogLevelString[
FATAL] <<
"] ";
479 *
fFileStream <<
"For later analysis we write a core dump to" <<
486 freopen(corefile,
"w", stderr);
487 gSystem->StackTrace();