ZFFramework
Loading...
Searching...
No Matches
ZFCoreLog.h
Go to the documentation of this file.
1
7
8#ifndef _ZFI_ZFCoreLog_h_
9#define _ZFI_ZFCoreLog_h_
10
11#include "ZFCallerInfo.h"
12#include "zfstr.h"
13
15
16// ============================================================
20#define ZFASSERT_STATIC(cond, name) typedef char assert_failed_##name[(cond) ? 1 : -1];
21
25#if ZF_ENV_DEBUG
26 #define ZFDEBUG(...) __VA_ARGS__
27#else
28 #define ZFDEBUG(...)
29#endif
30
31// ============================================================
35typedef void (*ZFCoreLogOutputCallbackType)(ZF_IN const zfchar *s);
36extern ZFLIB_ZFCore void _ZFP_ZFCoreLogOutputCallbackDefault(ZF_IN const zfchar *s);
40#define ZFCoreLogOutputCallbackDefault _ZFP_ZFCoreLogOutputCallbackDefault
41
52
53// ============================================================
54extern ZFLIB_ZFCore void _ZFP_ZFCoreLog(
55 ZF_IN const ZFCallerInfo &callerInfo
56 , ZF_IN const zfchar *text
57 );
71#define ZFCoreLog(format, ...) _ZFP_ZFCoreLog(ZFCallerInfoCreate(), zfstr(format, ##__VA_ARGS__))
72
76#define ZFCoreLogTrim(format, ...) _ZFP_ZFCoreLog(ZFCallerInfoEmpty(), zfstr(format, ##__VA_ARGS__))
77
81#define ZFCoreLogDetail(callerInfo, format, ...) _ZFP_ZFCoreLog(callerInfo, zfstr(format, ##__VA_ARGS__))
82
83// ============================================================
87typedef void (*ZFCoreCriticalErrorCallback)(ZF_IN const ZFCallerInfo &callerInfo, ZF_IN_OUT zfstring &errorHint);
88
97
98extern ZFLIB_ZFCore void _ZFP_ZFCoreCriticalError(ZF_IN const ZFCallerInfo &callerInfo, ZF_IN const zfchar *errorHint);
99
106#define ZFCoreCriticalError(errorHint) _ZFP_ZFCoreCriticalError(ZFCallerInfoCreate(), errorHint)
108#define ZFCoreCriticalErrorDetail(callerInfo, errorHint) _ZFP_ZFCoreCriticalError(callerInfo, errorHint)
109
111
112#endif // #ifndef _ZFI_ZFCoreLog_h_
113
caller info utils
#define ZFLIB_ZFCore
used to export symbols
Definition ZFCoreEnvDef.h:30
void ZFCoreCriticalErrorCallbackRemove(ZFCoreCriticalErrorCallback callback)
see ZFCoreCriticalErrorCallback
ZFCoreLogOutputCallbackType ZFCoreLogOutputCallback(void)
get the output callback for ZFCoreLog
void ZFCoreCriticalErrorCallbackAdd(ZFCoreCriticalErrorCallback callback)
see ZFCoreCriticalErrorCallback
void(* ZFCoreLogOutputCallbackType)(const zfchar *s)
output callback for ZFCoreLog
Definition ZFCoreLog.h:35
void(* ZFCoreCriticalErrorCallback)(const ZFCallerInfo &callerInfo, zfstring &errorHint)
callback which would be called if ZFCoreCriticalError is called
Definition ZFCoreLog.h:87
_ZFT_t_zfchar zfchar
char wrapper
Definition ZFCoreTypeDef_CharType.h:17
#define ZF_IN
dummy macro that shows the param used as required input
Definition ZFCoreTypeDef_ClassType.h:196
#define ZF_IN_OUT
dummy macro that shows the param used as required input and output
Definition ZFCoreTypeDef_ClassType.h:212
zft_zfstring< zfchar > zfstring
see zft_zfstring
Definition ZFCoreTypeDef_StringType.h:15
#define ZF_NAMESPACE_GLOBAL_BEGIN
begin namespace ZFFramework
Definition ZFNamespace.h:97
#define ZF_NAMESPACE_GLOBAL_END
end namespace ZFFramework
Definition ZFNamespace.h:98
util class to hold caller info
Definition ZFCallerInfo.h:63
string format util