AliRoot Core  3dc7879 (3dc7879)
AliLog.h
Go to the documentation of this file.
1 #ifndef ALILOG_H
2 #define ALILOG_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice */
5 
6 /* $Id$ */
7 
8 #include <TClass.h>
9 #include <TObjArray.h>
10 #include <TObject.h>
11 #include <TString.h>
12 
13 using std::ostream;
14 
15 // deprecation macro
16 #if defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
17 # define ALIROOT_DEPRECATED(func) func __attribute__ ((deprecated))
18 #elif defined(_MSC_VER) && _MSC_VER >= 1300
19 # define ALIROOT_DEPRECATED(func) __declspec(deprecated) func
20 #else
21 # define ALIROOT_DEPRECATED(func) func
22 #endif
23 
27 class AliLog: public TObject
28 {
29  public:
30 
31  // Log4j log levels: TRACE, DEBUG, INFO, WARN, ERROR, FATAL
33  typedef void (*AliLogNotification)(EType_t type, const char* message );
34 
35  // NB: singleton constructor & destructor should not be public!
36  // ALIROOT_DEPRECATED(AliLog());
37  // ALIROOT_DEPRECATED(virtual ~AliLog());
38 
39  // NB: singleton deprecated static instance method
40  // ALIROOT_DEPRECATED(static AliLog* Instance() {return fgInstance;};)
41 
42  // get root logger singleton instance
43  static AliLog *GetRootLogger();
44 
45  // delete root logger singleton instance
46  static void DeleteRootLogger();
47 
48  // NB: the following functions should not be static
49  // NB: deprecated: logging configuration should be made through to a configuration file
50  static void EnableCoreDump(Bool_t enabled);
51  static void MakeCoreDump(const char *fout);
52  static void EnableDebug(Bool_t enabled);
53  static void SetGlobalLogLevel(EType_t type);
54  static Int_t GetGlobalLogLevel();
55  static void SetGlobalDebugLevel(Int_t level);
56  static Int_t GetGlobalDebugLevel();
57  static void SetModuleDebugLevel(const char* module, Int_t level);
58  static void ClearModuleDebugLevel(const char* module);
59  static void SetClassDebugLevel(const char* className, Int_t level);
60  static void ClearClassDebugLevel(const char* className);
61 
62  static void SetStandardOutput();
63  static void SetStandardOutput(EType_t type);
64  static void SetErrorOutput();
65  static void SetErrorOutput(EType_t type);
66  static void SetFileOutput(const char* fileName);
67  static void SetFileOutput(EType_t type, const char* fileName);
68  static void SetStreamOutput(ostream* stream);
69  static void SetStreamOutput(EType_t type, ostream* stream);
70  static void SetLogNotification(AliLogNotification pCallBack);
71  static void SetLogNotification(EType_t type, AliLogNotification pCallBack);
72  static void Flush();
73 
74  static void SetHandleRootMessages(Bool_t on);
75 
76  static void SetPrintType(Bool_t on);
77  static void SetPrintType(EType_t type, Bool_t on);
78  static void SetPrintModule(Bool_t on);
79  static void SetPrintModule(EType_t type, Bool_t on);
80  static void SetPrintScope(Bool_t on);
81  static void SetPrintScope(EType_t type, Bool_t on);
82  static void SetPrintLocation(Bool_t on);
83  static void SetPrintLocation(EType_t type, Bool_t on);
84 
85  static void SetPrintRepetitions(Bool_t on);
86 
87  static void WriteToFile(const char* name, Int_t option = 0);
88 
89  // the following public methods are used by the preprocessor macros
90  // and should not be called directly
91  static Bool_t IsDebugEnabled() {return fgDebugEnabled;}
92  static Int_t GetDebugLevel(const char* module, const char* className);
93  static void Message(UInt_t level, const char* message,
94  const char* module, const char* className,
95  const char* function, const char* file, Int_t line);
96  static void Debug(UInt_t level, const char* message,
97  const char* module, const char* className,
98  const char* function, const char* file, Int_t line);
99 
100  static Int_t RedirectStdoutTo(EType_t type, UInt_t level, const char* module,
101  const char* className, const char* function,
102  const char* file, Int_t line, Bool_t print);
103  static Int_t RedirectStderrTo(EType_t type, UInt_t level, const char* module,
104  const char* className, const char* function,
105  const char* file, Int_t line, Bool_t print);
106  static void RestoreStdout(Int_t original);
107  static void RestoreStderr(Int_t original);
108 
109  static ostream& Stream(EType_t type, UInt_t level,
110  const char* module, const char* className,
111  const char* function, const char* file, Int_t line);
112  static void TestException(Int_t level=10);
113  private:
114 
115  // constructor is made private for implementing a singleton
116  AliLog();
117  virtual ~AliLog();
118 
119  // NOT IMPLEMENTED?
120  AliLog(const AliLog& log);
121  AliLog& operator = (const AliLog& log);
122 
123  void ReadEnvSettings();
124 
125  static void RootErrorHandler(Int_t level, Bool_t abort,
126  const char* location, const char* message);
127 
128  void CloseFile(Int_t type);
129  FILE* GetOutputStream(Int_t type);
130 
131  UInt_t GetLogLevel(const char* module, const char* className) const;
132  void PrintMessage(UInt_t type, const char* message,
133  const char* module, const char* className,
134  const char* function,
135  const char* file, Int_t line);
136 
137  void PrintString(Int_t type, FILE* stream, const char* format, ...);
138  void PrintRepetitions();
139 
140  Int_t RedirectTo(FILE* stream, EType_t type, UInt_t level,
141  const char* module, const char* className,
142  const char* function,
143  const char* file, Int_t line, Bool_t print);
144 
145  ostream& GetStream(EType_t type, UInt_t level,
146  const char* module, const char* className,
147  const char* function, const char* file, Int_t line);
148 
149  enum {kDebugOffset = kDebug-1};
150 
151  static AliLog* fgInstance;
152  static Bool_t fgDebugEnabled; // flag for debug en-/disabling
153  static Bool_t fgCoreEnabled; // flag for core dump en-/disabling
154 
155  UInt_t fGlobalLogLevel; // global logging level
156  TObjArray fModuleDebugLevels; // debug levels for modules
157  TObjArray fClassDebugLevels; // debug levels for classes
158 
159  Int_t fOutputTypes[kMaxType]; // types of output streams
160  TString fFileNames[kMaxType]; // file names
163 
164  Bool_t fPrintType[kMaxType]; // print type on/off
165  Bool_t fPrintModule[kMaxType]; // print module on/off
166  Bool_t fPrintScope[kMaxType]; // print scope/class name on/off
167  Bool_t fPrintLocation[kMaxType]; // print file and line on/off
168 
169  Bool_t fPrintRepetitions; // print number of repetitions instead of repeated message on/off
170 
171  Int_t fRepetitions;
172  UInt_t fLastType;
173  TString fLastMessage;
174  TString fLastModule;
175  TString fLastClassName;
176  TString fLastFunction;
177  TString fLastFile;
178  Int_t fLastLine;
180 
181  ClassDef(AliLog, 1) // class for logging debug, info and error messages
182 };
183 
184 
185 // module name macro
186 #ifdef _MODULE_
187 # define MODULENAME() _MODULE_
188 #else
189 # define MODULENAME() "NoModule"
190 #endif
191 
192 // function name macro
193 #if defined(__GNUC__) || defined(__ICC) || defined(__ECC) || defined(__APPLE__)
194 # define FUNCTIONNAME() __FUNCTION__
195 // #elif defined(__HP_aCC) || defined(__alpha) || defined(__DECCXX)
196 // #define FUNCTIONNAME() __FUNC__
197 #else
198 # define FUNCTIONNAME() "???"
199 #endif
200 
201 // redirection
210 #define REDIRECTSTDOUT(type, level, scope, whatever) \
211  do {Int_t originalStdout = AliLog::RedirectStdoutTo(type, level, MODULENAME(), scope, FUNCTIONNAME(), __FILE__, __LINE__, kFALSE); \
212  whatever; AliLog::RestoreStdout(originalStdout);} while(false)
213 
221 #define REDIRECTSTDERR(type, level, scope, whatever) \
222  do {Int_t originalStderr = AliLog::RedirectStderrTo(type, level, MODULENAME(), scope, FUNCTIONNAME(), __FILE__, __LINE__, kFALSE); \
223  whatever; AliLog::RestoreStderr(originalStderr);} while(false)
224 
232 #define REDIRECTSTDOUTANDSTDERR(type, level, scope, whatever) \
233  do {Int_t originalStdout = AliLog::RedirectStdoutTo(type, level, MODULENAME(), scope, FUNCTIONNAME(), __FILE__, __LINE__, kFALSE); \
234  Int_t originalStderr = AliLog::RedirectStderrTo(type, level, MODULENAME(), scope, FUNCTIONNAME(), __FILE__, __LINE__, kFALSE); \
235  whatever; AliLog::RestoreStderr(originalStderr); AliLog::RestoreStdout(originalStdout);} while(false)
236 
237 
238 // debug level
239 #ifdef LOG_NO_DEBUG
240 # define AliDebugLevel() -1
241 # define AliDebugLevelClass() -1
242 # define AliDebugLevelGeneral(scope) -1
243 #else
244 
247 # define AliDebugLevel() ((AliLog::IsDebugEnabled()) ? AliLog::GetDebugLevel(MODULENAME(), ClassName()) : -1)
248 
251 # define AliDebugLevelClass() ((AliLog::IsDebugEnabled()) ? AliLog::GetDebugLevel(MODULENAME(), Class()->GetName()) : -1)
252 
256 # define AliDebugLevelGeneral(scope) ((AliLog::IsDebugEnabled()) ? AliLog::GetDebugLevel(MODULENAME(), scope) : -1)
257 #endif
258 
259 // debug messages
260 #ifdef LOG_NO_DEBUG
261 # define AliDebug(level, message) do { } while (false)
262 # define AliDebugClass(level, message) do { } while (false)
263 # define AliDebugGeneral(scope, level, message) do { } while (false)
264 # define AliDebugF(level, message,...) do { } while (false)
265 # define AliDebugClassF(level, message,...) do { } while (false)
266 # define AliDebugGeneralF(scope, level, message,...) do { } while (false)
267 #else
268 
269 // inspired by log4cxx code (see log4cxx/Logger.h)
270 // implements GCC branch prediction for increasing logging performance
271 # if !defined(ALIROOT_UNLIKELY)
272 # if defined(__GNUC__) && (__GNUC__ >= 3)
273 
279 # define ALIROOT_UNLIKELY(expr) __builtin_expect(expr, 0)
280 # else
281 
287 # define ALIROOT_UNLIKELY(expr) expr
288 # endif
289 # endif
290 
300 # define AliDebug(logLevel, message) \
301  do { if (ALIROOT_UNLIKELY(AliLog::IsDebugEnabled() && AliLog::GetDebugLevel(MODULENAME(), ClassName()) >= logLevel)) {\
302  AliLog::Debug(logLevel, message, MODULENAME(), ClassName(), FUNCTIONNAME(), __FILE__, __LINE__); }} while (0)
303 
313 # define AliDebugClass(logLevel, message) \
314  do { if (ALIROOT_UNLIKELY(AliLog::IsDebugEnabled() && AliLog::GetDebugLevel(MODULENAME(), Class()->GetName()) >= logLevel)) {\
315  AliLog::Debug(logLevel, message, MODULENAME(), Class()->GetName(), FUNCTIONNAME(), __FILE__, __LINE__); }} while (0)
316 
327 # define AliDebugGeneral(scope, logLevel, message) \
328  do { if (ALIROOT_UNLIKELY(AliLog::IsDebugEnabled() && AliLog::GetDebugLevel(MODULENAME(), scope) >= logLevel)) {\
329  AliLog::Debug(logLevel, message, MODULENAME(), scope, FUNCTIONNAME(), __FILE__, __LINE__); }} while (0)
330 
338 # define AliDebugF(logLevel,format,...) \
339 do { if (ALIROOT_UNLIKELY(AliLog::IsDebugEnabled() && AliLog::GetDebugLevel(MODULENAME(), ClassName()) >= logLevel)) { \
340  TString m;m.Form(format,__VA_ARGS__); \
341  AliLog::Debug(logLevel, m, MODULENAME(), ClassName(), FUNCTIONNAME(), __FILE__, __LINE__); }} while (0)
342 
353 # define AliDebugClassF(logLevel,format,...) \
354  do { if (ALIROOT_UNLIKELY(AliLog::IsDebugEnabled() && AliLog::GetDebugLevel(MODULENAME(), Class()->GetName()) >= logLevel)) { \
355  TString m;m.Form(format,__VA_ARGS__); \
356  AliLog::Debug(logLevel, m, MODULENAME(), Class()->GetName(), FUNCTIONNAME(), __FILE__, __LINE__); }} while (0)
357 
369 # define AliDebugGeneralF(scope,logLevel,format,...) \
370  do { if (ALIROOT_UNLIKELY(AliLog::IsDebugEnabled() && AliLog::GetDebugLevel(MODULENAME(), scope) >= logLevel)) { \
371  TString m;m.Form(format,__VA_ARGS__); \
372  AliLog::Debug(logLevel, m, MODULENAME(), scope, FUNCTIONNAME(), __FILE__, __LINE__); }} while (0)
373 
374 #endif
375 
376 // redirection to debug
377 #define StdoutToAliDebug(level, whatever) REDIRECTSTDOUT(AliLog::kDebug, level, ClassName(), whatever)
378 #define StderrToAliDebug(level, whatever) REDIRECTSTDERR(AliLog::kDebug, level, ClassName(), whatever)
379 #define ToAliDebug(level, whatever) REDIRECTSTDOUTANDSTDERR(AliLog::kDebug, level, ClassName(), whatever)
380 #define StdoutToAliDebugClass(level, whatever) REDIRECTSTDOUT(AliLog::kDebug, level, Class()->GetName(), whatever)
381 #define StderrToAliDebugClass(level, whatever) REDIRECTSTDERR(AliLog::kDebug, level, Class()->GetName(), whatever)
382 #define ToAliDebugClass(level, whatever) REDIRECTSTDOUTANDSTDERR(AliLog::kDebug, level, Class()->GetName(), whatever)
383 #define StdoutToAliDebugGeneral(scope, level, whatever) REDIRECTSTDOUT(AliLog::kDebug, level, scope, whatever)
384 #define StderrToAliDebugGeneral(scope, level, whatever) REDIRECTSTDERR(AliLog::kDebug, level, scope, whatever)
385 #define ToAliDebugGeneral(scope, level, whatever) REDIRECTSTDOUTANDSTDERR(AliLog::kDebug, level, scope, whatever)
386 
387 // debug stream objects
388 #define AliDebugStream(level) AliLog::Stream(AliLog::kDebug, level, MODULENAME(), ClassName(), FUNCTIONNAME(), __FILE__, __LINE__)
389 #define AliDebugClassStream(level) AliLog::Stream(AliLog::kDebug, level, MODULENAME(), Class()->GetName(), FUNCTIONNAME(), __FILE__, __LINE__)
390 #define AliDebugGeneralStream(scope, level) AliLog::Stream(AliLog::kDebug, level, MODULENAME(), scope, FUNCTIONNAME(), __FILE__, __LINE__)
391 
392 
399 #define AliMessage(lvl,message) do { \
400  AliLog::Message(lvl, message, MODULENAME(), ClassName(), FUNCTIONNAME(), __FILE__, __LINE__);} while(false)
401 
408 #define AliMessageClass(lvl,message) do { \
409  AliLog::Message(lvl, message, MODULENAME(), Class()->GetName(), FUNCTIONNAME(), __FILE__, __LINE__);} while(false)
410 
418 #define AliMessageGeneral(scope,lvl,message) do { \
419  AliLog::Message(lvl, message, MODULENAME(), scope, FUNCTIONNAME(), __FILE__, __LINE__);} while(false)
420 
432 #define AliMessageF(lvl,format,...) do { \
433  TString m; m.Form(format,__VA_ARGS__); \
434  AliLog::Message(lvl, m, MODULENAME(), ClassName(), FUNCTIONNAME(), __FILE__, __LINE__);} while(false)
435 
449 #define AliMessageClassF(lvl,format,...) do { \
450  TString m; m.Form(format,__VA_ARGS__); \
451  AliLog::Message(lvl, m, MODULENAME(), Class()->GetName(), FUNCTIONNAME(), __FILE__, __LINE__);} while(false)
452 
467 #define AliMessageGeneralF(scope,lvl,format,...) do { \
468  TString m; m.Form(format,__VA_ARGS__); \
469  AliLog::Message(lvl, m, MODULENAME(), scope, FUNCTIONNAME(), __FILE__, __LINE__);} while(false)
470 
471 // info messages
472 #ifdef LOG_NO_INFO
473 # define AliInfo(message) do { } while (false)
474 # define AliInfoClass(message) do { } while (false)
475 # define AliInfoGeneral(scope, message) do { } while (false)
476 # define AliInfoF(message,...) do { } while (false)
477 # define AliInfoClassF(message,...) do { } while (false)
478 # define AliInfoGeneralF(scope, message,...) do { } while (false)
479 #else
480 
484 # define AliInfo(message) AliMessage(AliLog::kInfo, message)
485 
489 # define AliInfoClass(message) AliMessageClass(AliLog::kInfo, message)
490 
494 # define AliInfoGeneral(scope, message) AliMessageGeneral(scope, AliLog::kInfo, message)
495 
499 # define AliInfoF(message,...) AliMessageF(AliLog::kInfo, message, __VA_ARGS__)
500 
504 # define AliInfoClassF(message,...) AliMessageClassF(AliLog::kInfo, message, __VA_ARGS__)
505 
509 # define AliInfoGeneralF(scope,message,...) AliMessageGeneralF(scope, AliLog::kInfo, message, __VA_ARGS__)
510 #endif
511 
512 // redirection to info
513 #define StdoutToAliInfo(whatever) REDIRECTSTDOUT(AliLog::kInfo, 0, ClassName(), whatever)
514 #define StderrToAliInfo(whatever) REDIRECTSTDERR(AliLog::kInfo, 0, ClassName(), whatever)
515 #define ToAliInfo(whatever) REDIRECTSTDOUTANDSTDERR(AliLog::kInfo, 0, ClassName(), whatever)
516 #define StdoutToAliInfoClass(whatever) REDIRECTSTDOUT(AliLog::kInfo, 0, Class()->GetName(), whatever)
517 #define StderrToAliInfoClass(whatever) REDIRECTSTDERR(AliLog::kInfo, 0, Class()->GetName(), whatever)
518 #define ToAliInfoClass(whatever) REDIRECTSTDOUTANDSTDERR(AliLog::kInfo, 0, Class()->GetName(), whatever)
519 #define StdoutToAliInfoGeneral(scope, whatever) REDIRECTSTDOUT(AliLog::kInfo, 0, scope, whatever)
520 #define StderrToAliInfoGeneral(scope, whatever) REDIRECTSTDERR(AliLog::kInfo, 0, scope, whatever)
521 #define ToAliInfoGeneral(scope, whatever) REDIRECTSTDOUTANDSTDERR(AliLog::kInfo, 0, scope, whatever)
522 
523 // info stream objects
524 #define AliInfoStream() AliLog::Stream(AliLog::kInfo, 0, MODULENAME(), ClassName(), FUNCTIONNAME(), __FILE__, __LINE__)
525 #define AliInfoClassStream() AliLog::Stream(AliLog::kInfo, 0, MODULENAME(), Class()->GetName(), FUNCTIONNAME(), __FILE__, __LINE__)
526 #define AliInfoGeneralStream(scope) AliLog::Stream(AliLog::kInfo, 0, MODULENAME(), scope, FUNCTIONNAME(), __FILE__, __LINE__)
527 
528 // warning messages
529 #ifdef LOG_NO_WARNING
530 # define AliWarning(message) do { } while (false)
531 # define AliWarningClass(message) do { } while (false)
532 # define AliWarningGeneral(scope, message) do { } while (false)
533 # define AliWarningF(message,...) do { } while (false)
534 # define AliWarningClassF(message,...) do { } while (false)
535 # define AliWarningGeneralF(scope, message,...) do { } while (false)
536 #else
537 
541 # define AliWarning(message) AliMessage(AliLog::kWarning, message)
542 
546 # define AliWarningClass(message) AliMessageClass(AliLog::kWarning, message)
547 
551 # define AliWarningGeneral(scope, message) AliMessageGeneral(scope, AliLog::kWarning, message)
552 
556 # define AliWarningF(message,...) AliMessageF(AliLog::kWarning, message, __VA_ARGS__)
557 
561 # define AliWarningClassF(message,...) AliMessageClassF(AliLog::kWarning, message, __VA_ARGS__)
562 
566 # define AliWarningGeneralF(scope,message,...) AliMessageGeneralF(scope, AliLog::kWarning, message, __VA_ARGS__)
567 #endif
568 
569 // redirection to warning
570 #define StdoutToAliWarning(whatever) REDIRECTSTDOUT(AliLog::kWarning, 0, ClassName(), whatever)
571 #define StderrToAliWarning(whatever) REDIRECTSTDERR(AliLog::kWarning, 0, ClassName(), whatever)
572 #define ToAliWarning(whatever) REDIRECTSTDOUTANDSTDERR(AliLog::kWarning, 0, ClassName(), whatever)
573 #define StdoutToAliWarningClass(whatever) REDIRECTSTDOUT(AliLog::kWarning, 0, Class()->GetName(), whatever)
574 #define StderrToAliWarningClass(whatever) REDIRECTSTDERR(AliLog::kWarning, 0, Class()->GetName(), whatever)
575 #define ToAliWarningClass(whatever) REDIRECTSTDOUTANDSTDERR(AliLog::kWarning, 0, Class()->GetName(), whatever)
576 #define StdoutToAliWarningGeneral(scope, whatever) REDIRECTSTDOUT(AliLog::kWarning, 0, scope, whatever)
577 #define StderrToAliWarningGeneral(scope, whatever) REDIRECTSTDERR(AliLog::kWarning, 0, scope, whatever)
578 #define ToAliWarningGeneral(scope, whatever) REDIRECTSTDOUTANDSTDERR(AliLog::kWarning, 0, scope, whatever)
579 
580 // warning stream objects
581 #define AliWarningStream() AliLog::Stream(AliLog::kWarning, 0, MODULENAME(), ClassName(), FUNCTIONNAME(), __FILE__, __LINE__)
582 #define AliWarningClassStream() AliLog::Stream(AliLog::kWarning, 0, MODULENAME(), Class()->GetName(), FUNCTIONNAME(), __FILE__, __LINE__)
583 #define AliWarningGeneralStream(scope) AliLog::Stream(AliLog::kWarning, 0, MODULENAME(), scope, FUNCTIONNAME(), __FILE__, __LINE__)
584 
585 
586 // error messages
591 #define AliError(message) AliMessage(AliLog::kError, message)
592 
596 #define AliErrorClass(message) AliMessageClass(AliLog::kError, message)
597 
601 #define AliErrorGeneral(scope, message) AliMessageGeneral(scope, AliLog::kError, message)
602 
606 #define AliErrorF(message,...) AliMessageF(AliLog::kError, message, __VA_ARGS__)
607 
611 #define AliErrorClassF(message,...) AliMessageClassF(AliLog::kError, message, __VA_ARGS__)
612 
616 #define AliErrorGeneralF(scope,message,...) AliMessageGeneralF(scope, AliLog::kError, message, __VA_ARGS__)
617 
618 // redirection to error
619 #define StdoutToAliError(whatever) REDIRECTSTDOUT(AliLog::kError, 0, ClassName(), whatever)
620 #define StderrToAliError(whatever) REDIRECTSTDERR(AliLog::kError, 0, ClassName(), whatever)
621 #define ToAliError(whatever) REDIRECTSTDOUTANDSTDERR(AliLog::kError, 0, ClassName(), whatever)
622 #define StdoutToAliErrorClass(whatever) REDIRECTSTDOUT(AliLog::kError, 0, Class()->GetName(), whatever)
623 #define StderrToAliErrorClass(whatever) REDIRECTSTDERR(AliLog::kError, 0, Class()->GetName(), whatever)
624 #define ToAliErrorClass(whatever) REDIRECTSTDOUTANDSTDERR(AliLog::kError, 0, Class()->GetName(), whatever)
625 #define StdoutToAliErrorGeneral(scope, whatever) REDIRECTSTDOUT(AliLog::kError, 0, scope, whatever)
626 #define StderrToAliErrorGeneral(scope, whatever) REDIRECTSTDERR(AliLog::kError, 0, scope, whatever)
627 #define ToAliErrorGeneral(scope, whatever) REDIRECTSTDOUTANDSTDERR(AliLog::kError, 0, scope, whatever)
628 
629 // error stream objects
630 #define AliErrorStream() AliLog::Stream(AliLog::kError, 0, MODULENAME(), ClassName(), FUNCTIONNAME(), __FILE__, __LINE__)
631 #define AliErrorClassStream() AliLog::Stream(AliLog::kError, 0, MODULENAME(), Class()->GetName(), FUNCTIONNAME(), __FILE__, __LINE__)
632 #define AliErrorGeneralStream(scope) AliLog::Stream(AliLog::kError, 0, MODULENAME(), scope, FUNCTIONNAME(), __FILE__, __LINE__)
633 
634 
635 // fatal messages
640 #define AliFatal(message) AliMessage(AliLog::kFatal, message)
641 
645 #define AliFatalClass(message) AliMessageClass(AliLog::kFatal, message)
646 
650 #define AliFatalGeneral(scope, message) AliMessageGeneral(scope, AliLog::kFatal, message)
651 
655 #define AliFatalF(message,...) AliMessageF(AliLog::kFatal, message, __VA_ARGS__)
656 
660 #define AliFatalClassF(message,...) AliMessageClassF(AliLog::kFatal, message, __VA_ARGS__)
661 
665 #define AliFatalGeneralF(scope,message,...) AliMessageGeneralF(scope, AliLog::kFatal, message, __VA_ARGS__)
666 
667 #endif
AliLogNotification fCallBacks[kMaxType]
line number of last message
Definition: AliLog.h:179
TString fLastMessage
type of last message
Definition: AliLog.h:173
static void ClearModuleDebugLevel(const char *module)
Definition: AliLog.cxx:502
FILE * fOutputFiles[kMaxType]
Definition: AliLog.h:161
void(* AliLogNotification)(EType_t type, const char *message)
Definition: AliLog.h:33
void PrintString(Int_t type, FILE *stream, const char *format,...)
Definition: AliLog.cxx:1154
static void MakeCoreDump(const char *fout)
Definition: AliLog.cxx:1214
AliLog()
Definition: AliLog.cxx:97
static void SetGlobalLogLevel(EType_t type)
Definition: AliLog.cxx:447
#define TObjArray
TObjArray fClassDebugLevels
Definition: AliLog.h:157
static void SetClassDebugLevel(const char *className, Int_t level)
Definition: AliLog.cxx:513
static void RestoreStdout(Int_t original)
Definition: AliLog.cxx:1042
FILE * GetOutputStream(Int_t type)
Definition: AliLog.cxx:648
static void RootErrorHandler(Int_t level, Bool_t abort, const char *location, const char *message)
Definition: AliLog.cxx:397
Bool_t fPrintLocation[kMaxType]
Definition: AliLog.h:167
static void Message(UInt_t level, const char *message, const char *module, const char *className, const char *function, const char *file, Int_t line)
Definition: AliLog.cxx:929
static void SetFileOutput(const char *fileName)
Definition: AliLog.cxx:588
Int_t fOutputTypes[kMaxType]
Definition: AliLog.h:159
static void SetStreamOutput(ostream *stream)
Definition: AliLog.cxx:1105
static Bool_t fgDebugEnabled
pointer to current instance
Definition: AliLog.h:152
static void SetHandleRootMessages(Bool_t on)
Definition: AliLog.cxx:702
TString fLastFunction
class name of last message
Definition: AliLog.h:176
static AliLog * GetRootLogger()
Definition: AliLog.cxx:71
UInt_t fLastType
counter of repetitions
Definition: AliLog.h:172
TString fileName(const char *dir, int runNumber, const char *da, int i, const char *type)
static Bool_t fgCoreEnabled
Definition: AliLog.h:153
UInt_t fGlobalLogLevel
Definition: AliLog.h:155
ostream & GetStream(EType_t type, UInt_t level, const char *module, const char *className, const char *function, const char *file, Int_t line)
Definition: AliLog.cxx:1075
static void TestException(Int_t level=10)
Definition: AliLog.cxx:1240
static ostream & Stream(EType_t type, UInt_t level, const char *module, const char *className, const char *function, const char *file, Int_t line)
Definition: AliLog.cxx:1063
static AliLog * fgInstance
Definition: AliLog.h:151
static void SetLogNotification(AliLogNotification pCallBack)
Definition: AliLog.cxx:1133
static Int_t GetGlobalDebugLevel()
Definition: AliLog.cxx:476
virtual ~AliLog()
Definition: AliLog.cxx:142
static void WriteToFile(const char *name, Int_t option=0)
Definition: AliLog.cxx:816
AliLog & operator=(const AliLog &log)
Definition: AliLog.cxx:197
static Int_t RedirectStderrTo(EType_t type, UInt_t level, const char *module, const char *className, const char *function, const char *file, Int_t line, Bool_t print)
Definition: AliLog.cxx:991
Bool_t fPrintType[kMaxType]
log output streams
Definition: AliLog.h:164
Int_t fRepetitions
Definition: AliLog.h:171
TString fLastFile
function name of last message
Definition: AliLog.h:177
Bool_t fPrintModule[kMaxType]
Definition: AliLog.h:165
void ReadEnvSettings()
Definition: AliLog.cxx:215
Definition: AliLog.h:27
TFile * fout
Definition: PlotSys.C:39
static void SetModuleDebugLevel(const char *module, Int_t level)
Definition: AliLog.cxx:485
static void SetPrintModule(Bool_t on)
Definition: AliLog.cxx:737
static void SetPrintType(Bool_t on)
Definition: AliLog.cxx:716
static void EnableDebug(Bool_t enabled)
Definition: AliLog.cxx:422
static void Flush()
Definition: AliLog.cxx:685
static Bool_t IsDebugEnabled()
Definition: AliLog.h:91
TString fLastModule
last message
Definition: AliLog.h:174
static void SetGlobalDebugLevel(Int_t level)
Definition: AliLog.cxx:466
EType_t
Definition: AliLog.h:32
static void Debug(UInt_t level, const char *message, const char *module, const char *className, const char *function, const char *file, Int_t line)
Definition: AliLog.cxx:966
TString fLastClassName
module name of last message
Definition: AliLog.h:175
Bool_t fPrintRepetitions
Definition: AliLog.h:169
static void SetPrintRepetitions(Bool_t on)
Definition: AliLog.cxx:804
static void SetPrintScope(Bool_t on)
Definition: AliLog.cxx:758
static Int_t RedirectStdoutTo(EType_t type, UInt_t level, const char *module, const char *className, const char *function, const char *file, Int_t line, Bool_t print)
Definition: AliLog.cxx:979
static Int_t GetDebugLevel(const char *module, const char *className)
Definition: AliLog.cxx:843
void PrintMessage(UInt_t type, const char *message, const char *module, const char *className, const char *function, const char *file, Int_t line)
Definition: AliLog.cxx:852
void PrintRepetitions()
Definition: AliLog.cxx:919
Int_t fLastLine
file name of last message
Definition: AliLog.h:178
ostream * fOutputStreams[kMaxType]
log output files
Definition: AliLog.h:162
static void ClearClassDebugLevel(const char *className)
Definition: AliLog.cxx:530
Int_t RedirectTo(FILE *stream, EType_t type, UInt_t level, const char *module, const char *className, const char *function, const char *file, Int_t line, Bool_t print)
Definition: AliLog.cxx:1003
static Int_t GetGlobalLogLevel()
Definition: AliLog.cxx:457
UInt_t GetLogLevel(const char *module, const char *className) const
Definition: AliLog.cxx:826
TString fFileNames[kMaxType]
Definition: AliLog.h:160
static void SetStandardOutput()
Definition: AliLog.cxx:542
static void SetPrintLocation(Bool_t on)
Definition: AliLog.cxx:780
void CloseFile(Int_t type)
Definition: AliLog.cxx:623
static void DeleteRootLogger()
Definition: AliLog.cxx:85
static void EnableCoreDump(Bool_t enabled)
Definition: AliLog.cxx:429
static void RestoreStderr(Int_t original)
Definition: AliLog.cxx:1052
static void SetErrorOutput()
Definition: AliLog.cxx:565
Bool_t fPrintScope[kMaxType]
Definition: AliLog.h:166
TObjArray fModuleDebugLevels
Definition: AliLog.h:156