AliRoot Core  edcc906 (edcc906)
AliLog Class Reference

#include <AliLog.h>

Inheritance diagram for AliLog:

Public Types

enum  EType_t {
  kFatal = 0, kError, kWarning, kInfo,
  kDebug, kMaxType
}
 
typedef void(* AliLogNotification) (EType_t type, const char *message)
 

Static Public Member Functions

static AliLogGetRootLogger ()
 
static void DeleteRootLogger ()
 
static void EnableCoreDump (Bool_t enabled)
 
static void MakeCoreDump (const char *fout)
 
static void EnableDebug (Bool_t enabled)
 
static void SetGlobalLogLevel (EType_t type)
 
static Int_t GetGlobalLogLevel ()
 
static void SetGlobalDebugLevel (Int_t level)
 
static Int_t GetGlobalDebugLevel ()
 
static void SetModuleDebugLevel (const char *module, Int_t level)
 
static void ClearModuleDebugLevel (const char *module)
 
static void SetClassDebugLevel (const char *className, Int_t level)
 
static void ClearClassDebugLevel (const char *className)
 
static void SetStandardOutput ()
 
static void SetStandardOutput (EType_t type)
 
static void SetErrorOutput ()
 
static void SetErrorOutput (EType_t type)
 
static void SetFileOutput (const char *fileName)
 
static void SetFileOutput (EType_t type, const char *fileName)
 
static void SetStreamOutput (ostream *stream)
 
static void SetStreamOutput (EType_t type, ostream *stream)
 
static void SetLogNotification (AliLogNotification pCallBack)
 
static void SetLogNotification (EType_t type, AliLogNotification pCallBack)
 
static void Flush ()
 
static void SetHandleRootMessages (Bool_t on)
 
static void SetPrintType (Bool_t on)
 
static void SetPrintType (EType_t type, Bool_t on)
 
static void SetPrintModule (Bool_t on)
 
static void SetPrintModule (EType_t type, Bool_t on)
 
static void SetPrintScope (Bool_t on)
 
static void SetPrintScope (EType_t type, Bool_t on)
 
static void SetPrintLocation (Bool_t on)
 
static void SetPrintLocation (EType_t type, Bool_t on)
 
static void SetPrintRepetitions (Bool_t on)
 
static void WriteToFile (const char *name, Int_t option=0)
 
static Bool_t IsDebugEnabled ()
 
static Int_t GetDebugLevel (const char *module, const char *className)
 
static void Message (UInt_t level, const char *message, const char *module, const char *className, const char *function, const char *file, Int_t line)
 
static void Debug (UInt_t level, const char *message, const char *module, const char *className, const char *function, const char *file, Int_t line)
 
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)
 
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)
 
static void RestoreStdout (Int_t original)
 
static void RestoreStderr (Int_t original)
 
static ostream & Stream (EType_t type, UInt_t level, const char *module, const char *className, const char *function, const char *file, Int_t line)
 
static void TestException (Int_t level=10)
 

Private Types

enum  { kDebugOffset = kDebug-1 }
 

Private Member Functions

 AliLog ()
 
virtual ~AliLog ()
 
 AliLog (const AliLog &log)
 
AliLogoperator= (const AliLog &log)
 
void ReadEnvSettings ()
 
void CloseFile (Int_t type)
 
FILE * GetOutputStream (Int_t type)
 
UInt_t GetLogLevel (const char *module, const char *className) const
 
void PrintMessage (UInt_t type, const char *message, const char *module, const char *className, const char *function, const char *file, Int_t line)
 
void PrintString (Int_t type, FILE *stream, const char *format,...)
 
void PrintRepetitions ()
 
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)
 
ostream & GetStream (EType_t type, UInt_t level, const char *module, const char *className, const char *function, const char *file, Int_t line)
 

Static Private Member Functions

static void RootErrorHandler (Int_t level, Bool_t abort, const char *location, const char *message)
 

Private Attributes

UInt_t fGlobalLogLevel
 
TObjArray fModuleDebugLevels
 
TObjArray fClassDebugLevels
 
Int_t fOutputTypes [kMaxType]
 
TString fFileNames [kMaxType]
 
FILE * fOutputFiles [kMaxType]
 
ostream * fOutputStreams [kMaxType]
 log output files More...
 
Bool_t fPrintType [kMaxType]
 log output streams More...
 
Bool_t fPrintModule [kMaxType]
 
Bool_t fPrintScope [kMaxType]
 
Bool_t fPrintLocation [kMaxType]
 
Bool_t fPrintRepetitions
 
Int_t fRepetitions
 
UInt_t fLastType
 counter of repetitions More...
 
TString fLastMessage
 type of last message More...
 
TString fLastModule
 last message More...
 
TString fLastClassName
 module name of last message More...
 
TString fLastFunction
 class name of last message More...
 
TString fLastFile
 function name of last message More...
 
Int_t fLastLine
 file name of last message More...
 
AliLogNotification fCallBacks [kMaxType]
 line number of last message More...
 

Static Private Attributes

static AliLogfgInstance = NULL
 
static Bool_t fgDebugEnabled = kTRUE
 pointer to current instance More...
 
static Bool_t fgCoreEnabled = kFALSE
 

Detailed Description

class for logging debug, info and error messages

Definition at line 27 of file AliLog.h.

Member Typedef Documentation

typedef void(* AliLog::AliLogNotification) (EType_t type, const char *message)

Definition at line 33 of file AliLog.h.

Member Enumeration Documentation

anonymous enum
private
Enumerator
kDebugOffset 

Definition at line 149 of file AliLog.h.

Enumerator
kFatal 
kError 
kWarning 
kInfo 
kDebug 
kMaxType 

Definition at line 32 of file AliLog.h.

Constructor & Destructor Documentation

AliLog::~AliLog ( )
privatevirtual

private destructor

Definition at line 142 of file AliLog.cxx.

Referenced by IsDebugEnabled().

AliLog::AliLog ( const AliLog log)
private

Definition at line 175 of file AliLog.cxx.

Member Function Documentation

void AliLog::ClearClassDebugLevel ( const char *  className)
static

Definition at line 530 of file AliLog.cxx.

void AliLog::ClearModuleDebugLevel ( const char *  module)
static

Definition at line 502 of file AliLog.cxx.

void AliLog::CloseFile ( Int_t  type)
private
void AliLog::Debug ( UInt_t  level,
const char *  message,
const char *  module,
const char *  className,
const char *  function,
const char *  file,
Int_t  line 
)
static

Definition at line 966 of file AliLog.cxx.

Referenced by IsDebugEnabled().

void AliLog::DeleteRootLogger ( )
static

delete the root logger singleton instance

Definition at line 85 of file AliLog.cxx.

void AliLog::EnableCoreDump ( Bool_t  enabled)
static

Definition at line 429 of file AliLog.cxx.

Referenced by ReadEnvSettings().

void AliLog::EnableDebug ( Bool_t  enabled)
static

Definition at line 422 of file AliLog.cxx.

Referenced by AliFMDBaseDA::Runner::Init().

void AliLog::Flush ( )
static

Definition at line 685 of file AliLog.cxx.

Referenced by AliFMDRawReader::ReadbackError(), rec(), recMag5(), and runDataReconstruction().

Int_t AliLog::GetGlobalLogLevel ( )
static

Definition at line 457 of file AliLog.cxx.

UInt_t AliLog::GetLogLevel ( const char *  module,
const char *  className 
) const
private

Definition at line 826 of file AliLog.cxx.

Referenced by GetDebugLevel(), GetStream(), IsDebugEnabled(), Message(), and RedirectTo().

FILE * AliLog::GetOutputStream ( Int_t  type)
private

Definition at line 648 of file AliLog.cxx.

Referenced by GetStream(), IsDebugEnabled(), PrintMessage(), PrintRepetitions(), and RedirectTo().

AliLog * AliLog::GetRootLogger ( )
static

get root logger singleton instance

Definition at line 71 of file AliLog.cxx.

Referenced by AliMUONCDB::CheckHV_ALIROOT_6402(), AliMUONCDB::ShowFaultyBusPatches(), and AliMUONCDB::ShowFaultyPedestalsBusPatches().

ostream & AliLog::GetStream ( EType_t  type,
UInt_t  level,
const char *  module,
const char *  className,
const char *  function,
const char *  file,
Int_t  line 
)
private

Definition at line 1075 of file AliLog.cxx.

Referenced by IsDebugEnabled(), and Stream().

static Bool_t AliLog::IsDebugEnabled ( )
inlinestatic

Definition at line 91 of file AliLog.h.

void AliLog::MakeCoreDump ( const char *  fout)
static

Definition at line 1214 of file AliLog.cxx.

Referenced by Message().

void AliLog::Message ( UInt_t  level,
const char *  message,
const char *  module,
const char *  className,
const char *  function,
const char *  file,
Int_t  line 
)
static
AliLog & AliLog::operator= ( const AliLog log)
private

Definition at line 197 of file AliLog.cxx.

Referenced by IsDebugEnabled().

void AliLog::PrintMessage ( UInt_t  type,
const char *  message,
const char *  module,
const char *  className,
const char *  function,
const char *  file,
Int_t  line 
)
private

Definition at line 852 of file AliLog.cxx.

Referenced by GetStream(), IsDebugEnabled(), Message(), and RedirectTo().

void AliLog::PrintRepetitions ( )
private

Definition at line 919 of file AliLog.cxx.

Referenced by IsDebugEnabled(), PrintMessage(), SetPrintRepetitions(), and ~AliLog().

void AliLog::PrintString ( Int_t  type,
FILE *  stream,
const char *  format,
  ... 
)
private

Definition at line 1154 of file AliLog.cxx.

Referenced by IsDebugEnabled(), PrintMessage(), and PrintRepetitions().

void AliLog::ReadEnvSettings ( )
private

gSystem see TSystem.h gEnv see TEnv.h

LOG_NO_DEBUG: fgDebugEnabled <- false AliRoot.AliLog.EnableDebug AliRoot.AliLog.GlobalLogLevel

Definition at line 215 of file AliLog.cxx.

Referenced by AliLog(), and IsDebugEnabled().

Int_t AliLog::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 
)
static

Definition at line 991 of file AliLog.cxx.

Referenced by IsDebugEnabled().

Int_t AliLog::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 
)
static

Definition at line 979 of file AliLog.cxx.

Referenced by IsDebugEnabled().

Int_t AliLog::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 
)
private

Definition at line 1003 of file AliLog.cxx.

Referenced by IsDebugEnabled(), RedirectStderrTo(), and RedirectStdoutTo().

void AliLog::RestoreStderr ( Int_t  original)
static

Definition at line 1052 of file AliLog.cxx.

Referenced by IsDebugEnabled().

void AliLog::RestoreStdout ( Int_t  original)
static

Definition at line 1042 of file AliLog.cxx.

Referenced by IsDebugEnabled().

void AliLog::RootErrorHandler ( Int_t  level,
Bool_t  abort,
const char *  location,
const char *  message 
)
staticprivate

Definition at line 397 of file AliLog.cxx.

Referenced by IsDebugEnabled(), and SetHandleRootMessages().

void AliLog::SetErrorOutput ( )
static

Definition at line 565 of file AliLog.cxx.

Referenced by ReadEnvSettings().

void AliLog::SetErrorOutput ( EType_t  type)
static

Definition at line 577 of file AliLog.cxx.

void AliLog::SetFileOutput ( const char *  fileName)
static

Definition at line 588 of file AliLog.cxx.

Referenced by ReadEnvSettings().

void AliLog::SetFileOutput ( EType_t  type,
const char *  fileName 
)
static

Definition at line 606 of file AliLog.cxx.

void AliLog::SetGlobalDebugLevel ( Int_t  level)
static
void AliLog::SetHandleRootMessages ( Bool_t  on)
static

Definition at line 702 of file AliLog.cxx.

Referenced by AliLog(), and ReadEnvSettings().

void AliLog::SetLogNotification ( AliLogNotification  pCallBack)
static

Definition at line 1133 of file AliLog.cxx.

void AliLog::SetLogNotification ( EType_t  type,
AliLogNotification  pCallBack 
)
static

Definition at line 1142 of file AliLog.cxx.

void AliLog::SetPrintLocation ( Bool_t  on)
static

Definition at line 780 of file AliLog.cxx.

void AliLog::SetPrintLocation ( EType_t  type,
Bool_t  on 
)
static

Definition at line 792 of file AliLog.cxx.

void AliLog::SetPrintModule ( Bool_t  on)
static

Definition at line 737 of file AliLog.cxx.

void AliLog::SetPrintModule ( EType_t  type,
Bool_t  on 
)
static

Definition at line 748 of file AliLog.cxx.

void AliLog::SetPrintRepetitions ( Bool_t  on)
static

Definition at line 804 of file AliLog.cxx.

Referenced by AliFMDRawReader::ReadAdcs().

void AliLog::SetPrintScope ( Bool_t  on)
static

Definition at line 758 of file AliLog.cxx.

void AliLog::SetPrintScope ( EType_t  type,
Bool_t  on 
)
static

Definition at line 769 of file AliLog.cxx.

void AliLog::SetPrintType ( Bool_t  on)
static

Definition at line 716 of file AliLog.cxx.

void AliLog::SetPrintType ( EType_t  type,
Bool_t  on 
)
static

Definition at line 727 of file AliLog.cxx.

void AliLog::SetStandardOutput ( )
static

Definition at line 542 of file AliLog.cxx.

Referenced by ReadEnvSettings().

void AliLog::SetStandardOutput ( EType_t  type)
static

Definition at line 554 of file AliLog.cxx.

void AliLog::SetStreamOutput ( ostream *  stream)
static

Definition at line 1105 of file AliLog.cxx.

Referenced by main().

void AliLog::SetStreamOutput ( EType_t  type,
ostream *  stream 
)
static

Definition at line 1116 of file AliLog.cxx.

ostream & AliLog::Stream ( EType_t  type,
UInt_t  level,
const char *  module,
const char *  className,
const char *  function,
const char *  file,
Int_t  line 
)
static

Definition at line 1063 of file AliLog.cxx.

Referenced by IsDebugEnabled().

void AliLog::TestException ( Int_t  level = 10)
static

Definition at line 1240 of file AliLog.cxx.

Referenced by IsDebugEnabled().

void AliLog::WriteToFile ( const char *  name,
Int_t  option = 0 
)
static

Definition at line 816 of file AliLog.cxx.

Member Data Documentation

AliLogNotification AliLog::fCallBacks[kMaxType]
private

line number of last message

Definition at line 179 of file AliLog.h.

Referenced by AliLog(), PrintMessage(), PrintRepetitions(), and SetLogNotification().

TObjArray AliLog::fClassDebugLevels
private

Definition at line 157 of file AliLog.h.

Referenced by ClearClassDebugLevel(), GetLogLevel(), SetClassDebugLevel(), and ~AliLog().

TString AliLog::fFileNames[kMaxType]
private

Definition at line 160 of file AliLog.h.

Referenced by AliLog(), CloseFile(), GetOutputStream(), RedirectTo(), SetFileOutput(), and SetStreamOutput().

Bool_t AliLog::fgCoreEnabled = kFALSE
staticprivate

Definition at line 153 of file AliLog.h.

Referenced by EnableCoreDump(), and Message().

Bool_t AliLog::fgDebugEnabled = kTRUE
staticprivate

pointer to current instance

Definition at line 152 of file AliLog.h.

Referenced by EnableDebug(), IsDebugEnabled(), and ReadEnvSettings().

UInt_t AliLog::fGlobalLogLevel
private
TString AliLog::fLastClassName
private

module name of last message

Definition at line 175 of file AliLog.h.

Referenced by PrintMessage().

TString AliLog::fLastFile
private

function name of last message

Definition at line 177 of file AliLog.h.

Referenced by PrintMessage().

TString AliLog::fLastFunction
private

class name of last message

Definition at line 176 of file AliLog.h.

Referenced by PrintMessage().

Int_t AliLog::fLastLine
private

file name of last message

Definition at line 178 of file AliLog.h.

Referenced by PrintMessage().

TString AliLog::fLastMessage
private

type of last message

Definition at line 173 of file AliLog.h.

Referenced by PrintMessage().

TString AliLog::fLastModule
private

last message

Definition at line 174 of file AliLog.h.

Referenced by PrintMessage().

UInt_t AliLog::fLastType
private

counter of repetitions

Definition at line 172 of file AliLog.h.

Referenced by PrintMessage(), and PrintRepetitions().

TObjArray AliLog::fModuleDebugLevels
private

Definition at line 156 of file AliLog.h.

Referenced by ClearModuleDebugLevel(), GetLogLevel(), SetModuleDebugLevel(), and ~AliLog().

FILE* AliLog::fOutputFiles[kMaxType]
private

Definition at line 161 of file AliLog.h.

Referenced by AliLog(), CloseFile(), Flush(), GetOutputStream(), SetFileOutput(), and SetStreamOutput().

ostream* AliLog::fOutputStreams[kMaxType]
private

log output files

Definition at line 162 of file AliLog.h.

Referenced by AliLog(), CloseFile(), Flush(), GetOutputStream(), GetStream(), PrintString(), SetFileOutput(), and SetStreamOutput().

Int_t AliLog::fOutputTypes[kMaxType]
private
Bool_t AliLog::fPrintLocation[kMaxType]
private

Definition at line 167 of file AliLog.h.

Referenced by AliLog(), PrintMessage(), ReadEnvSettings(), and SetPrintLocation().

Bool_t AliLog::fPrintModule[kMaxType]
private

Definition at line 165 of file AliLog.h.

Referenced by AliLog(), PrintMessage(), ReadEnvSettings(), and SetPrintModule().

Bool_t AliLog::fPrintRepetitions
private

Definition at line 169 of file AliLog.h.

Referenced by PrintMessage(), ReadEnvSettings(), and SetPrintRepetitions().

Bool_t AliLog::fPrintScope[kMaxType]
private

Definition at line 166 of file AliLog.h.

Referenced by AliLog(), PrintMessage(), ReadEnvSettings(), and SetPrintScope().

Bool_t AliLog::fPrintType[kMaxType]
private

log output streams

Definition at line 164 of file AliLog.h.

Referenced by AliLog(), PrintMessage(), ReadEnvSettings(), and SetPrintType().

Int_t AliLog::fRepetitions
private

Definition at line 171 of file AliLog.h.

Referenced by PrintMessage(), PrintRepetitions(), SetPrintRepetitions(), and ~AliLog().


The documentation for this class was generated from the following files: