thread-safe log utility More...
Go to the source code of this file.
Classes | |
class | ZFLogFormat |
output format for ZFLog More... | |
Macros | |
#define | ZFLog(...) |
thread-safe log utility | |
#define | ZFLogTrim(...) |
see ZFLog | |
Typedefs | |
typedef zfstring(* | ZFLogHeaderFunc) (const ZFCallerInfo &callerInfo) |
see ZFLogHeader | |
Functions | |
ZFMutex * | ZFLogMutex () |
mutex used by ZFLog, you may use this lock to prevent your log actions from being interrupted | |
zfstring | ZFLogHeaderDefault (const ZFCallerInfo &callerInfo) |
see ZFLogHeader | |
zfbool & | ZFLogHeaderDefault_logTime (void) |
see ZFLogHeader, enabled by default | |
void | ZFLogHeaderDefault_logTime (zfbool const &v) |
see ZFLogHeaderDefault_logTime | |
zfbool & | ZFLogHeaderDefault_logCaller (void) |
see ZFLogHeader, enabled by default, set to false if v_ZFLogLevel::e_Verbose is not active | |
void | ZFLogHeaderDefault_logCaller (zfbool const &v) |
see ZFLogHeaderDefault_logCaller | |
void | ZFLogFormatDefault (ZFLogFormat *fmt) |
change default log format | |
ZFLogFormat * | ZFLogFormatDefault () |
get default log format | |
zfstring | ZFLogCurTimeString () |
get a string contains current time with format HH:mm:ss.SSS | |
Variables | |
ZFLogHeaderFunc | ZFLogHeader |
callback to obtain log header for ZFLog | |
thread-safe log utility
#define ZFLog | ( | ... | ) |
thread-safe log utility
typical usage:
ZFLog is actually an output callback, you can output anything that ZFOutput supported
final log content would be written to ZFOutputDefault, which can be easily redirected to other output destinations
ZFLog is thread-safe, implemented by ZFLogMutex
by default, ZFLog would automatically:
these behavior can be changed by:
and they would be reset to default state after each ZFLog call
|
extern |
mutex used by ZFLog, you may use this lock to prevent your log actions from being interrupted
note, the mutex would be initialized only after ZFLevelZFFrameworkEssential
|
extern |
callback to obtain log header for ZFLog
set to ZFLogHeaderDefault at ZFLevelZFFrameworkStatic, set to null to disable header info
by default, the header would looks like this (not ensured):
"12:34:56.123 [file scope::function (line)] "
the default header can be configured by: