ACE的 日志

本文介绍了ACE日志系统的宏调用方法及其参数详解,包括不同级别的日志输出宏和格式化参数的使用方式。
http://wenku.baidu.com/link?url=dK6j9_0pICRjxWW7usBlkCxPTa8zFSPyUe_uWAkwMPFDU4ip_tEfxpOitxjkl3RuPy3D7g7YeAyyH1TFj69F0CR0b-1uuqmvBIcMcyD94Ca

可以看出ACE日志系统的宏调用非常简单:
 ACE_XXX((severity, formatting-args));
其中,ACE_XXX表示日志输出宏(ACE Logging Macros),包括:
ACE_ERROR((level, string, ...))
ACE_DEBUG((level, string, ...))
ACE_TRACE(string)
ACE_ASSERT(test)
ACE_HEX_DUMP((level, buffer, size [,text]))
ACE_RETURN(value)
ACE_ERROR_RETURN((level, string, ...), value)
ACE_ERROR_INIT( value, flags )
ACE_ERROR_BREAK((level, string, ...))
severity即输出的严重等级(Severity Level),包括:
LM_TRACE  Messages indicating function-calling sequence
LM_DEBUG  Debugging information
LM_INFO   Messages that contain information normally of use only when debugging a program
LM_NOTICE  Conditions that are not error conditions but that may require special handling
LM_WARNING  Warning messages
LM_ERROR  Error messages
LM_CRITICAL  Critical conditions, such as hard device errors
LM_ALERT  A condition that should be corrected immediately, such as a corrupted database
LM_EMERGENCY     A panic condition, normally broadcast to all usersLM_TRACE Messages indicating
                 function-calling sequence
formatting-args是要输出的内容,格式类似于printf函数的输出格式:
Code        Argument Type   Displays
A           ACE_timer_t     浮点数
a           —              导致程序终止(Abort)
c           char            单个字符
C           char*           字符串(narrow characters)
i,d         int             10进制整数
I           —              缩进
e,E,f,F,g,G double          双精度浮点数
l           —              行号
M           —              severity level的名称
m           —              错误号(errorno)
N           —              文件名
n           —              ACE_Log_Msg::open()指定的程序名
o           int             八进制整数
P           —              当前进程ID
p           ACE_TCHAR*      字符串,后接错误号,同perror
Q           ACE_UINT64      64位无符号十进制整数
r           void (*)()      函数调用
R           int             十进制整数
S           int             数字对应的信号名称
s           ACE_TCHAR*      ACE_TCHAR类型的字符串
T           —              当前时间(hour:minute:sec.usec)
D           —              时戳(month/day/year/hour:minute:sec.usec)
t           —              当前线程ID
u           int             无符号十进制整数
w           wchar_t         Single wide character
W           wchar_t*        Wide-character string
x,X         int             十六进制数
@           void*           指针(十六进制)
%           N/A             %

转载于:https://www.cnblogs.com/jacklikedogs/p/4275206.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值