22#define __MESSAGETEXTLENGTH__ 1024
28#define GO4MESSAGE( X ) TGo4Log::Message X;
29#define GO4INFO(X) TGo4Log::Info X ;
30#define GO4WARN(X) TGo4Log::Warn X ;
31#define GO4ERROR(X) TGo4Log::Error X ;
33#if defined(__GNUC__) && !defined(__CLING__)
34#define GO4_PRINTF_ARGS __attribute__((format(printf, 1, 2)))
35#define GO4_PRINTF2_ARGS __attribute__((format(printf, 2, 3)))
37#define GO4_PRINTF_ARGS
38#define GO4_PRINTF2_ARGS
58 static const char *
GO4SYS();
65 static TString
subGO4SYS(
const char *subdir);
96 const char *headercomment =
nullptr,
97 Bool_t appendmode = kFALSE);
126 static
void Printf(Bool_t _stdout, const
char *text);
129 static
void PrintRate(ULong64_t cnt,
double rate);
133 static
void WriteLogfile(const
char *text, Bool_t withtime = kTRUE);
#define __MESSAGETEXTLENGTH__
This class handles all logging messages inside Go4.
static void StartTracing()
For backward compatibility.
static const char * fgcDEFAULTLOG
Name of default logfile.
static void set_trace_level(int)
dummy for compatibility
static TGo4Log * Instance()
static TString subGO4SYS(const char *subdir)
Return subdirectory in the GO4SYS.
static void StopTracing()
For backward compatibility.
static void Warn(const char *text,...) GO4_PRINTF_ARGS
User shortcut for message with prio 2.
static Bool_t IsAutoEnabled()
get current user boolean
static void ProcessRedirection(int kind=0)
static void Info(const char *text,...) GO4_PRINTF_ARGS
User shortcut for message with prio 1.
static void PrintRate(ULong64_t cnt, double rate)
Printout rate and events count, handle redirection.
static Bool_t fgbOutputEnabled
General switch on/off log output.
static const char * GetLogname()
get name of last opened logfile
static void WriteLogfile(const char *text, Bool_t withtime=kTRUE)
Write text to current logfile if this is open.
static const char * Message(Int_t prio, const char *text,...) GO4_PRINTF2_ARGS
Display a message.
static const char * GO4SYS()
Return GO4SYS environment variable or Go4 top directory during compile (if GO4SYS) not set.
static const char * fgcINFO
Info message indicator.
static char fgcMessagetext[__MESSAGETEXTLENGTH__]
Keeps latest message with all format indicators.
static Bool_t IsLogfileEnabled()
get current logfile state
static void Printf(Bool_t _stdout, const char *text)
Make direct printf without log file or logger.
static const char * fgcRIGHT
Prompt character right side.
static const char * fgcERR
Error message indicator.
static void SetIgnoreLevel(Int_t level)
Define threshold for output.
static const char * fgcWARN
Warning message indicator.
static void LogfileEnable(Bool_t on=kTRUE)
switch writing to logfile on or off
static void SetSniffer(TNamed *sniff)
static int fgStdPipe[2]
optional object to get all output via SetTitle method
static Int_t fgiIgnoreLevel
all Messages with lower level are suppressed
static void Debug(const char *text,...) GO4_PRINTF_ARGS
User shortcut for message with prio 0.
static const char * fgcDEBUG
System debug message indicator.
static TString fgxLogName
Name of last logfile set.
static const char * GO4INCPATH()
Return include path for this Go4 installation.
static void SetTracePriority(int)
dummy for compatibility
static void AutoEnable(Bool_t on=kTRUE)
set boolean for user action
static TMutex * fgxMutex
we use own mutex to protect the logging instance
static void EnableRedirection()
static void OutputEnable(Bool_t on=kTRUE)
switch output on or off
static void Error(const char *text,...) GO4_PRINTF_ARGS
User shortcut for message with prio 3.
static int fgStdSave
redirected pipe for stdout
static Bool_t fgbAutoMode
User boolean to write log on demand or not.
static Bool_t IsOutputEnabled()
get current output state
static TNamed * fgSniffer
value of GO4SYS during run
static Int_t GetIgnoreLevel()
Get threshold for output.
static void OpenLogfile(const char *name=nullptr, const char *headercomment=nullptr, Bool_t appendmode=kFALSE)
Open file of name for logmessage output.
static void * fgxLogfile
optional logfile to store messages with time
static void CloseLogfile()
Close logfile if existing.
static const char * fgcLEFT
Prompt character left side.
static const char * GetDefaultLogname()
Return default name of log file.
static Bool_t fgbLogfileEnabled
General switch on/off log file output.
static TGo4Log * fgxInstance
static TLogTimer * fgTimer
saved file for stdout