TGo4Log Class Reference

#include <TGo4Log.h>

List of all members.

Public Types

enum  { fguMESLEN = __MESSAGETEXTLENGTH__ }
 Maximum message length allowd. More...

Public Member Functions

virtual ~TGo4Log ()

Static Public Member Functions

static TGo4LogInstance ()
static const char * GO4SYS ()
 Return GO4SYS environment variable or Go4 top directory during compile (if GO4SYS) not set.
static TString subGO4SYS (const char *subdir)
 Return subdirectory in the GO4SYS.
static void SetIgnoreLevel (Int_t level)
 Define threshold for output.
static Int_t GetIgnoreLevel ()
 Get threshold for output.
static void OutputEnable (Bool_t on=kTRUE)
 switch output on or off
static Bool_t IsOutputEnabled ()
 get current output state
static void LogfileEnable (Bool_t on=kTRUE)
 switch writing to logfile on or off
static Bool_t IsLogfileEnabled ()
 get current logfile state
static void AutoEnable (Bool_t on=kTRUE)
 set boolean for user action
static Bool_t IsAutoEnabled ()
 get current user boolean
static void OpenLogfile (const char *name=0, const char *headercomment=0, Bool_t appendmode=kFALSE)
 Open file of name for logmessage output.
static void CloseLogfile ()
 Close logfile if existing.
static const char * GetLogname ()
 get name of last opened logfile
static const char * Message (Int_t prio, const char *text,...)
 Display a message.
static void Debug (const char *text,...)
 User shortcut for message with prio 0.
static void Info (const char *text,...)
 User shortcut for message with prio 1.
static void Warn (const char *text,...)
 User shortcut for message with prio 2.
static void Error (const char *text,...)
 User shortcut for message with prio 3.
static void WriteLogfile (const char *text, Bool_t withtime=kTRUE)
 Write text to current logfile if this is open.
static void set_trace_level (int)
 dummy for compatibility
static void SetTracePriority (int)
 dummy for compatibility
static void StartTracing ()
 For backward compatibility.
static void StopTracing ()
 For backward compatibility.
static const char * GetDefaultLogname ()

Static Public Attributes

static const char * fgcLEFT = "GO4-"
 Prompt character left side.
static const char * fgcRIGHT = " "
 Prompt character right side.
static const char * fgcDEBUG = "d"
 System debug message indicator.
static const char * fgcINFO = "*"
 Info message indicator.
static const char * fgcWARN = "#"
 Warning message indicator.
static const char * fgcERR = "!"
 Error message indicator.
static const char * fgcDEFAULTLOG = "go4logfile.txt"
 Name of default logfile.

Private Member Functions

 TGo4Log ()

Static Private Attributes

static TGo4LogfgxInstance = 0
static TMutex * fgxMutex = 0
 we use own mutex to protect the logging instance
static Int_t fgiIgnoreLevel = 1
 all Messages with lower level are suppressed
static Bool_t fgbOutputEnabled = kTRUE
 General switch on/off log output.
static Bool_t fgbLogfileEnabled = kFALSE
 General switch on/off log file output.
static Bool_t fgbAutoMode = kFALSE
 User boolean to write log on demand or not.
static char fgcMessagetext [__MESSAGETEXTLENGTH__]
 Keeps latest message with all format indicators.
static void * fgxLogfile = 0
 optional logfile to store messages with time
static TString fgxLogName = TGo4Log::fgcDEFAULTLOG
 Name of last logfile set.
static TString fgsGO4SYS = ""


Detailed Description

Definition at line 52 of file TGo4Log.h.


Member Enumeration Documentation

anonymous enum

Maximum message length allowd.

Enumerator:
fguMESLEN 

Definition at line 166 of file TGo4Log.h.


Constructor & Destructor Documentation

TGo4Log::~TGo4Log (  )  [virtual]

Definition at line 60 of file TGo4Log.cxx.

TGo4Log::TGo4Log (  )  [private]

Definition at line 47 of file TGo4Log.cxx.


Member Function Documentation

TGo4Log * TGo4Log::Instance (  )  [static]

Definition at line 65 of file TGo4Log.cxx.

const char * TGo4Log::GO4SYS (  )  [static]

Return GO4SYS environment variable or Go4 top directory during compile (if GO4SYS) not set.

Always add trailing slash into the end of the string.

Definition at line 73 of file TGo4Log.cxx.

TString TGo4Log::subGO4SYS ( const char *  subdir  )  [static]

Return subdirectory in the GO4SYS.

Always add trailing slash into the end of the string.

Definition at line 96 of file TGo4Log.cxx.

void TGo4Log::SetIgnoreLevel ( Int_t  level  )  [static]

Define threshold for output.

Definition at line 204 of file TGo4Log.cxx.

Int_t TGo4Log::GetIgnoreLevel (  )  [static]

Get threshold for output.

Definition at line 210 of file TGo4Log.cxx.

void TGo4Log::OutputEnable ( Bool_t  on = kTRUE  )  [static]

switch output on or off

Definition at line 225 of file TGo4Log.cxx.

Bool_t TGo4Log::IsOutputEnabled (  )  [static]

get current output state

Definition at line 231 of file TGo4Log.cxx.

void TGo4Log::LogfileEnable ( Bool_t  on = kTRUE  )  [static]

switch writing to logfile on or off

Definition at line 236 of file TGo4Log.cxx.

Bool_t TGo4Log::IsLogfileEnabled (  )  [static]

get current logfile state

Definition at line 242 of file TGo4Log.cxx.

void TGo4Log::AutoEnable ( Bool_t  on = kTRUE  )  [static]

set boolean for user action

Definition at line 247 of file TGo4Log.cxx.

Bool_t TGo4Log::IsAutoEnabled (  )  [static]

get current user boolean

Definition at line 253 of file TGo4Log.cxx.

void TGo4Log::OpenLogfile ( const char *  name = 0,
const char *  headercomment = 0,
Bool_t  appendmode = kFALSE 
) [static]

Open file of name for logmessage output.

If name=0, use defaultname containing pid. Optionally, headercomment text is set at beginning of file. If appendmode is true, existing file of same name is reused and extended by new messages.

Definition at line 258 of file TGo4Log.cxx.

void TGo4Log::CloseLogfile (  )  [static]

Close logfile if existing.

Definition at line 316 of file TGo4Log.cxx.

const char * TGo4Log::GetLogname (  )  [static]

get name of last opened logfile

Definition at line 215 of file TGo4Log.cxx.

const char * TGo4Log::Message ( Int_t  prio,
const char *  text,
  ... 
) [static]

Display a message.

Argument pri defines message priority: 0: debug / trace output 1: info message 2: warning message >=3: error message Method returns formatted message string as printed out for further use

Definition at line 115 of file TGo4Log.cxx.

void TGo4Log::Debug ( const char *  text,
  ... 
) [static]

User shortcut for message with prio 0.

Definition at line 152 of file TGo4Log.cxx.

void TGo4Log::Info ( const char *  text,
  ... 
) [static]

User shortcut for message with prio 1.

Definition at line 165 of file TGo4Log.cxx.

void TGo4Log::Warn ( const char *  text,
  ... 
) [static]

User shortcut for message with prio 2.

Definition at line 178 of file TGo4Log.cxx.

void TGo4Log::Error ( const char *  text,
  ... 
) [static]

User shortcut for message with prio 3.

Definition at line 191 of file TGo4Log.cxx.

void TGo4Log::WriteLogfile ( const char *  text,
Bool_t  withtime = kTRUE 
) [static]

Write text to current logfile if this is open.

Prefix current datime in each line if "withtime" is true

Definition at line 295 of file TGo4Log.cxx.

static void TGo4Log::set_trace_level ( int   )  [inline, static]

dummy for compatibility

Definition at line 131 of file TGo4Log.h.

static void TGo4Log::SetTracePriority ( int   )  [inline, static]

dummy for compatibility

Definition at line 134 of file TGo4Log.h.

static void TGo4Log::StartTracing (  )  [inline, static]

For backward compatibility.

Definition at line 137 of file TGo4Log.h.

static void TGo4Log::StopTracing (  )  [inline, static]

For backward compatibility.

Definition at line 140 of file TGo4Log.h.

const char * TGo4Log::GetDefaultLogname (  )  [static]

Definition at line 220 of file TGo4Log.cxx.


Member Data Documentation

const char * TGo4Log::fgcLEFT = "GO4-" [static]

Prompt character left side.

Definition at line 145 of file TGo4Log.h.

const char * TGo4Log::fgcRIGHT = " " [static]

Prompt character right side.

Definition at line 148 of file TGo4Log.h.

const char * TGo4Log::fgcDEBUG = "d" [static]

System debug message indicator.

Definition at line 151 of file TGo4Log.h.

const char * TGo4Log::fgcINFO = "*" [static]

Info message indicator.

Definition at line 154 of file TGo4Log.h.

const char * TGo4Log::fgcWARN = "#" [static]

Warning message indicator.

Definition at line 157 of file TGo4Log.h.

const char * TGo4Log::fgcERR = "!" [static]

Error message indicator.

Definition at line 160 of file TGo4Log.h.

const char * TGo4Log::fgcDEFAULTLOG = "go4logfile.txt" [static]

Name of default logfile.

Definition at line 163 of file TGo4Log.h.

TGo4Log * TGo4Log::fgxInstance = 0 [static, private]

Definition at line 173 of file TGo4Log.h.

TMutex * TGo4Log::fgxMutex = 0 [static, private]

we use own mutex to protect the logging instance

Definition at line 176 of file TGo4Log.h.

Int_t TGo4Log::fgiIgnoreLevel = 1 [static, private]

all Messages with lower level are suppressed

Definition at line 179 of file TGo4Log.h.

Bool_t TGo4Log::fgbOutputEnabled = kTRUE [static, private]

General switch on/off log output.

Definition at line 182 of file TGo4Log.h.

Bool_t TGo4Log::fgbLogfileEnabled = kFALSE [static, private]

General switch on/off log file output.

Definition at line 185 of file TGo4Log.h.

Bool_t TGo4Log::fgbAutoMode = kFALSE [static, private]

User boolean to write log on demand or not.

Definition at line 188 of file TGo4Log.h.

char TGo4Log::fgcMessagetext [static, private]

Keeps latest message with all format indicators.

Definition at line 191 of file TGo4Log.h.

void * TGo4Log::fgxLogfile = 0 [static, private]

optional logfile to store messages with time

Definition at line 194 of file TGo4Log.h.

TString TGo4Log::fgxLogName = TGo4Log::fgcDEFAULTLOG [static, private]

Name of last logfile set.

Definition at line 197 of file TGo4Log.h.

TString TGo4Log::fgsGO4SYS = "" [static, private]

Definition at line 199 of file TGo4Log.h.


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

Generated on Thu Oct 28 12:35:17 2010 for Go4-ThreadManagerv4.04-2 by  doxygen 1.5.6