#include <TGo4Log.h>
Public Types | |
enum | { fguMESLEN = __MESSAGETEXTLENGTH__ } |
Maximum message length allowd. More... | |
Public Member Functions | |
virtual | ~TGo4Log () |
Static Public Member Functions | |
static TGo4Log * | Instance () |
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 TGo4Log * | fgxInstance = 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 = "" |
Definition at line 52 of file TGo4Log.h.
anonymous enum |
TGo4Log::~TGo4Log | ( | ) | [virtual] |
Definition at line 60 of file TGo4Log.cxx.
TGo4Log::TGo4Log | ( | ) | [private] |
Definition at line 47 of file TGo4Log.cxx.
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] |
Int_t TGo4Log::GetIgnoreLevel | ( | ) | [static] |
void TGo4Log::OutputEnable | ( | Bool_t | on = kTRUE |
) | [static] |
Bool_t TGo4Log::IsOutputEnabled | ( | ) | [static] |
void TGo4Log::LogfileEnable | ( | Bool_t | on = kTRUE |
) | [static] |
Bool_t TGo4Log::IsLogfileEnabled | ( | ) | [static] |
void TGo4Log::AutoEnable | ( | Bool_t | on = kTRUE |
) | [static] |
Bool_t TGo4Log::IsAutoEnabled | ( | ) | [static] |
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] |
const char * TGo4Log::GetLogname | ( | ) | [static] |
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] |
void TGo4Log::Info | ( | const char * | text, | |
... | ||||
) | [static] |
void TGo4Log::Warn | ( | const char * | text, | |
... | ||||
) | [static] |
void TGo4Log::Error | ( | const char * | text, | |
... | ||||
) | [static] |
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] |
static void TGo4Log::SetTracePriority | ( | int | ) | [inline, static] |
static void TGo4Log::StartTracing | ( | ) | [inline, static] |
static void TGo4Log::StopTracing | ( | ) | [inline, static] |
const char * TGo4Log::GetDefaultLogname | ( | ) | [static] |
Definition at line 220 of file TGo4Log.cxx.
const char * TGo4Log::fgcLEFT = "GO4-" [static] |
const char * TGo4Log::fgcRIGHT = " " [static] |
const char * TGo4Log::fgcDEBUG = "d" [static] |
const char * TGo4Log::fgcINFO = "*" [static] |
const char * TGo4Log::fgcWARN = "#" [static] |
const char * TGo4Log::fgcERR = "!" [static] |
const char * TGo4Log::fgcDEFAULTLOG = "go4logfile.txt" [static] |
TGo4Log * TGo4Log::fgxInstance = 0 [static, private] |
TMutex * TGo4Log::fgxMutex = 0 [static, private] |
Int_t TGo4Log::fgiIgnoreLevel = 1 [static, private] |
Bool_t TGo4Log::fgbOutputEnabled = kTRUE [static, private] |
Bool_t TGo4Log::fgbLogfileEnabled = kFALSE [static, private] |
Bool_t TGo4Log::fgbAutoMode = kFALSE [static, private] |
char TGo4Log::fgcMessagetext [static, private] |
void * TGo4Log::fgxLogfile = 0 [static, private] |
TString TGo4Log::fgxLogName = TGo4Log::fgcDEFAULTLOG [static, private] |
TString TGo4Log::fgsGO4SYS = "" [static, private] |