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": 表示全部日誌級別 |