Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
阿啄debugIT
libfastcommon
提交
2c83c992
L
libfastcommon
项目概览
阿啄debugIT
/
libfastcommon
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
libfastcommon
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
2c83c992
编写于
7月 15, 2018
作者:
Y
yuqing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
logger.h use gcc attribute to check format
上级
3e479013
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
56 addition
and
20 deletion
+56
-20
src/common_define.h
src/common_define.h
+6
-0
src/logger.h
src/logger.h
+50
-20
未找到文件。
src/common_define.h
浏览文件 @
2c83c992
...
...
@@ -200,6 +200,12 @@ typedef void* (*MallocFunc)(size_t size);
#endif
#ifdef __GNUC__
#define __gcc_attribute__ __attribute__
#else
#define __gcc_attribute__(x)
#endif
#ifdef __cplusplus
}
#endif
...
...
src/logger.h
浏览文件 @
2c83c992
...
...
@@ -282,7 +282,7 @@ void log_destroy_ex(LogContext *pContext);
* return: none
*/
void
log_it_ex
(
LogContext
*
pContext
,
const
int
priority
,
\
const
char
*
format
,
...);
const
char
*
format
,
...)
__gcc_attribute__
((
format
(
printf
,
3
,
4
)))
;
/** log to file
* parameters:
...
...
@@ -347,16 +347,32 @@ const char *log_get_level_caption_ex(LogContext *pContext);
#define log_get_level_caption() log_get_level_caption_ex(&g_log_context)
void
logEmergEx
(
LogContext
*
pContext
,
const
char
*
format
,
...);
void
logCritEx
(
LogContext
*
pContext
,
const
char
*
format
,
...);
void
logAlertEx
(
LogContext
*
pContext
,
const
char
*
format
,
...);
void
logErrorEx
(
LogContext
*
pContext
,
const
char
*
format
,
...);
void
logWarningEx
(
LogContext
*
pContext
,
const
char
*
format
,
...);
void
logNoticeEx
(
LogContext
*
pContext
,
const
char
*
format
,
...);
void
logInfoEx
(
LogContext
*
pContext
,
const
char
*
format
,
...);
void
logDebugEx
(
LogContext
*
pContext
,
const
char
*
format
,
...);
void
logAccess
(
LogContext
*
pContext
,
struct
timeval
*
tvStart
,
\
const
char
*
format
,
...);
void
logEmergEx
(
LogContext
*
pContext
,
const
char
*
format
,
...)
__gcc_attribute__
((
format
(
printf
,
2
,
3
)));
void
logCritEx
(
LogContext
*
pContext
,
const
char
*
format
,
...)
__gcc_attribute__
((
format
(
printf
,
2
,
3
)));
void
logAlertEx
(
LogContext
*
pContext
,
const
char
*
format
,
...)
__gcc_attribute__
((
format
(
printf
,
2
,
3
)));
void
logErrorEx
(
LogContext
*
pContext
,
const
char
*
format
,
...)
__gcc_attribute__
((
format
(
printf
,
2
,
3
)));
void
logWarningEx
(
LogContext
*
pContext
,
const
char
*
format
,
...)
__gcc_attribute__
((
format
(
printf
,
2
,
3
)));
void
logNoticeEx
(
LogContext
*
pContext
,
const
char
*
format
,
...)
__gcc_attribute__
((
format
(
printf
,
2
,
3
)));
void
logInfoEx
(
LogContext
*
pContext
,
const
char
*
format
,
...)
__gcc_attribute__
((
format
(
printf
,
2
,
3
)));
void
logDebugEx
(
LogContext
*
pContext
,
const
char
*
format
,
...)
__gcc_attribute__
((
format
(
printf
,
2
,
3
)));
void
logAccess
(
LogContext
*
pContext
,
struct
timeval
*
tvStart
,
const
char
*
format
,
...)
__gcc_attribute__
((
format
(
printf
,
3
,
4
)));
//#define LOG_FORMAT_CHECK
...
...
@@ -374,14 +390,29 @@ void logAccess(LogContext *pContext, struct timeval *tvStart, \
#else
/* following functions use global log context: g_log_context */
void
logEmerg
(
const
char
*
format
,
...);
void
logCrit
(
const
char
*
format
,
...);
void
logAlert
(
const
char
*
format
,
...);
void
logError
(
const
char
*
format
,
...);
void
logWarning
(
const
char
*
format
,
...);
void
logNotice
(
const
char
*
format
,
...);
void
logInfo
(
const
char
*
format
,
...);
void
logDebug
(
const
char
*
format
,
...);
void
logEmerg
(
const
char
*
format
,
...)
__gcc_attribute__
((
format
(
printf
,
1
,
2
)));
void
logCrit
(
const
char
*
format
,
...)
__gcc_attribute__
((
format
(
printf
,
1
,
2
)));
void
logAlert
(
const
char
*
format
,
...)
__gcc_attribute__
((
format
(
printf
,
1
,
2
)));
void
logError
(
const
char
*
format
,
...)
__gcc_attribute__
((
format
(
printf
,
1
,
2
)));
void
logWarning
(
const
char
*
format
,
...)
__gcc_attribute__
((
format
(
printf
,
1
,
2
)));
void
logNotice
(
const
char
*
format
,
...)
__gcc_attribute__
((
format
(
printf
,
1
,
2
)));
void
logInfo
(
const
char
*
format
,
...)
__gcc_attribute__
((
format
(
printf
,
1
,
2
)));
void
logDebug
(
const
char
*
format
,
...)
__gcc_attribute__
((
format
(
printf
,
1
,
2
)));
#endif
...
...
@@ -390,4 +421,3 @@ void logDebug(const char *format, ...);
#endif
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录