Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
levels.hpp
Go to the documentation of this file.
1/*
2 * Copyright (c) 2014, Peter Thorson. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
6 * * Redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer.
8 * * Redistributions in binary form must reproduce the above copyright
9 * notice, this list of conditions and the following disclaimer in the
10 * documentation and/or other materials provided with the distribution.
11 * * Neither the name of the WebSocket++ Project nor the
12 * names of its contributors may be used to endorse or promote products
13 * derived from this software without specific prior written permission.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL PETER THORSON BE LIABLE FOR ANY
19 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 */
27
28#ifndef WEBSOCKETPP_LOGGER_LEVELS_HPP
29#define WEBSOCKETPP_LOGGER_LEVELS_HPP
30
32
33namespace websocketpp {
34namespace log {
35
38
40
48 typedef uint32_t value;
49
51 static value const none = 0;
53 static value const access = 1;
55 static value const error = 2;
56};
57
59struct elevel {
61 static level const none = 0x0;
63 static level const devel = 0x1;
66 static level const library = 0x2;
69 static level const info = 0x4;
72 static level const warn = 0x8;
75 static level const rerror = 0x10;
78 static level const fatal = 0x20;
80 static level const all = 0xffffffff;
81
83
91 static char const * channel_name(level channel) {
92 switch(channel) {
93 case devel:
94 return "devel";
95 case library:
96 return "library";
97 case info:
98 return "info";
99 case warn:
100 return "warning";
101 case rerror:
102 return "error";
103 case fatal:
104 return "fatal";
105 default:
106 return "unknown";
107 }
108 }
109};
110
112struct alevel {
114 static level const none = 0x0;
116
121 static level const connect = 0x1;
123 static level const disconnect = 0x2;
125 static level const control = 0x4;
127 static level const frame_header = 0x8;
129 static level const frame_payload = 0x10;
131 static level const message_header = 0x20;
133 static level const message_payload = 0x40;
135 static level const endpoint = 0x80;
137 static level const debug_handshake = 0x100;
139 static level const debug_close = 0x200;
141 static level const devel = 0x400;
143 static level const app = 0x800;
145 static level const http = 0x1000;
147 static level const fail = 0x2000;
150 static level const access_core = 0x00003003;
152 static level const all = 0xffffffff;
153
155
164 static char const * channel_name(level channel) {
165 switch(channel) {
166 case connect:
167 return "connect";
168 case disconnect:
169 return "disconnect";
170 case control:
171 return "control";
172 case frame_header:
173 return "frame_header";
174 case frame_payload:
175 return "frame_payload";
176 case message_header:
177 return "message_header";
178 case message_payload:
179 return "message_payload";
180 case endpoint:
181 return "endpoint";
182 case debug_handshake:
183 return "debug_handshake";
184 case debug_close:
185 return "debug_close";
186 case devel:
187 return "devel";
188 case app:
189 return "application";
190 case http:
191 return "http";
192 case fail:
193 return "fail";
194 default:
195 return "unknown";
196 }
197 }
198};
199
200} // logger
201} // websocketpp
202
203#endif //WEBSOCKETPP_LOGGER_LEVELS_HPP
Creates and manages connections associated with a WebSocket endpoint.
Definition endpoint.hpp:42
uint32_t level
Type of a channel package.
Definition levels.hpp:37
Namespace for the WebSocket++ project.
Definition base64.hpp:41
unsigned int uint32_t
Definition stdint.h:126
Package of log levels for logging access events.
Definition levels.hpp:112
static char const * channel_name(level channel)
Get the textual name of a channel given a channel id.
Definition levels.hpp:164
static level const fail
One line for each failed WebSocket connection with details.
Definition levels.hpp:147
static level const none
Special aggregate value representing "no levels".
Definition levels.hpp:114
static level const debug_handshake
Extra information about opening handshakes.
Definition levels.hpp:137
static level const devel
Development messages (warning: very chatty)
Definition levels.hpp:141
static level const all
Special aggregate value representing "all levels".
Definition levels.hpp:152
static level const debug_close
Extra information about closing handshakes.
Definition levels.hpp:139
static level const frame_payload
One line per frame, includes the full message payload (warning: chatty)
Definition levels.hpp:129
static level const connect
Information about new connections.
Definition levels.hpp:121
static level const app
Special channel for application specific logs. Not used by the library.
Definition levels.hpp:143
static level const frame_header
One line per frame, includes the full frame header.
Definition levels.hpp:127
static level const message_payload
Reserved.
Definition levels.hpp:133
static level const endpoint
Reserved.
Definition levels.hpp:135
static level const message_header
Reserved.
Definition levels.hpp:131
static level const control
One line per control frame.
Definition levels.hpp:125
static level const disconnect
One line for each closed connection. Includes closing codes and reasons.
Definition levels.hpp:123
static level const access_core
Definition levels.hpp:150
static level const http
Access related to HTTP requests.
Definition levels.hpp:145
Package of values for hinting at the nature of a given logger.
Definition levels.hpp:46
static value const none
No information.
Definition levels.hpp:51
uint32_t value
Type of a channel type hint value.
Definition levels.hpp:48
Package of log levels for logging errors.
Definition levels.hpp:59
static level const devel
Low level debugging information (warning: very chatty)
Definition levels.hpp:63
static char const * channel_name(level channel)
Get the textual name of a channel given a channel id.
Definition levels.hpp:91
static level const library
Definition levels.hpp:66
static level const info
Definition levels.hpp:69
static level const all
Special aggregate value representing "all levels".
Definition levels.hpp:80
static level const fatal
Definition levels.hpp:78
static level const none
Special aggregate value representing "no levels".
Definition levels.hpp:61
static level const rerror
Definition levels.hpp:75
static level const warn
Definition levels.hpp:72