28 #include "dabc/defines.h"
38 class LoggerLineEntry;
66 Logger(
bool withmutex =
true);
92 virtual void LogFile(
const char* fname);
93 virtual void Syslog(
const char* prefix);
106 static inline void Debug(
int level,
const char* filename,
unsigned linenumber,
const char* funcname,
const char* message)
116 virtual void DoOutput(
int level,
const char* filename,
unsigned linenumber,
const char* funcname,
const char* message);
146 #define DOUT(level, args ... ) \
147 dabc::Logger::Debug(level, __FILE__, __LINE__, __func__, dabc::format( args ).c_str())
150 #define EOUT( args ... ) DOUT(-1, args )
152 #define EOUT( args ... )
156 #define DOUT0( args ... ) DOUT(0, args )
158 #define DOUT0( args ... )
162 #define DOUT1( args ... ) DOUT(1, args )
164 #define DOUT1( args )
168 #define DOUT2( args ... ) DOUT( 2, args )
170 #define DOUT2( args ... )
174 #define DOUT3( args ... ) DOUT(3, args )
176 #define DOUT3( args ... )
180 #define DOUT4( args ... ) DOUT(4, args )
182 #define DOUT4( args ... )
186 #define DOUT5( args ... ) DOUT(5, args )
188 #define DOUT5( args ... )
191 #define DBOOL(arg) (arg ? "true" : "false")
193 #define DNAME(arg) (arg ? arg->GetName() : "---")
199 extern Logger*
lgr();
void SetFileLevel(int level=0)
void SetErrorMask(unsigned mask)
LoggerLineEntry ** fLines
unsigned GetErrorMask() const
virtual void Syslog(const char *prefix)
void SetLogLimit(unsigned limit=100)
void CloseFile()
Close any file open by logger.
virtual void LogFile(const char *fname)
void SetPrefix(const char *prefix=0)
Logger(bool withmutex=true)
unsigned GetDebugMask() const
void SetSyslogLevel(int level=0)
std::string fSyslogPrefix
void SetDebugMask(unsigned mask)
static Logger * Instance()
static void DisableLogReopen()
void ShowStat(bool tofile=true)
virtual void _DoCheckTimeout()
void _ExtendLines(unsigned max)
void SetDebugLevel(int level=0)
virtual void DoOutput(int level, const char *filename, unsigned linenumber, const char *funcname, const char *message)
int GetDebugLevel() const
void SetFileMask(unsigned mask)
static void Debug(int level, const char *filename, unsigned linenumber, const char *funcname, const char *message)
static void CheckTimeout()
void _FillString(std::string &str, unsigned mask, LoggerEntry *entry)
unsigned GetFileMask() const
void SetDebugLevel(int level=0)
void SetDebugPrefix(const char *prefix=0)
void SetFileLevel(int level=0)