websocket++序列: Logger

▼魔方 西西 提交于 2020-04-13 17:04:47

【今日推荐】:为什么一到面试就懵逼!>>>

1.  日志类型

1.1 类别

日志类型 说明
websocketpp::log::alevel 接入日志,默认只有debug/development日志
websocketpp::log::elevel 错误日志

1.2 日志策略

日志策略 备注
websocketpp::log::basic 基本日志策略,写日志到std::ostream,默认策略
websocketpp::log::syslog POSIX系统日志
websocketpp::log::stub 存根日志,

1.3 设置函数

日志类型 函数 说明
websocketpp::log::elevel

clear_error_channels(level)

set_error_channels(level)

level参考2.2,默认只有debug/development级别关闭
websocketpp::log::alevel

clear_access_channels(level)

set_access_channels(level)

level参考2.1,默认只有debug/development级别关闭

2. 日志级别

2.1 错误日志级别

Level Description
none Special aggregate value representing "no levels": 关闭全部日志级别
devel Low level debugging information (warning: very chatty). Requires debug or custom config.: 低级调试信息,要求debug或custom配置
library Information about unusual system states or other minor internal library problems, less chatty than devel.: 关于系统状态或其他最小内部库问题的信息,比devel级别输出少
info Information about minor configuration problems or additional information about other warnings.: 关于最小配置问题信息或其他警告的额外信息
warn Information about important problems not severe enough to terminate connections.: 警告
rerror Recoverable error. Recovery may mean cleanly closing the connection with an appropriate error code to the remote endpoint.:可恢复的错误
fatal Unrecoverable error. This error will trigger immediate unclean termination of the connection or endpoint.: 不可恢复错误
all Special aggregate value representing "all levels": 全部日志级别

2.2 接入日志级别

Level Description
none Special aggregate value representing "no levels":关闭全部日志级别
connect One line for each new connection that includes a host of information including: the remote address, websocket version, requested resource, http code, remote user agent: 一行包含一条connection日志
disconnect One line for each connection that is closed. Includes closing codes and reasons:一行包含一条connect关闭日志
control One line per control message: 一行包含一条控制消息日志
frame_header One line per frame, includes the full frame header: 一行包含一帧,只包含帧头
frame_payload One line per frame, includes the full message payload (warning: lots of output for large messages): 一行包含一帧,只包含消息载荷
message_header Reserved:保留
message_payload Reserved:保留
endpoint Reserved:保留
debug_handshake Extra information about opening handshakes: 打开握手的额外信息
debug_close Extra information about closing handshakes: 关闭握手的额外信息
devel Development messages (warning: very chatty). Requires debug or custom config: development消息,要求debug或custom 配置
app Special channel for application specific logs. Not used by the library.应用定制日志
all Special aggregate value representing "all levels": 表示全部日志级别

 

发布了211 篇原创文章 · 获赞 109 · 访问量 32万+
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!