websocketpp  0.4.0
C++/Boost Asio based websocket client/server library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
levels.hpp
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 
31 #include <websocketpp/common/stdint.hpp>
32 
33 namespace websocketpp {
34 namespace log {
35 
37 typedef uint32_t level;
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 
59 struct 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 
112 struct 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 all = 0xffffffff;
146 
148 
157  static char const * channel_name(level channel) {
158  switch(channel) {
159  case connect:
160  return "connect";
161  case disconnect:
162  return "disconnect";
163  case control:
164  return "control";
165  case frame_header:
166  return "frame_header";
167  case frame_payload:
168  return "frame_payload";
169  case message_header:
170  return "message_header";
171  case message_payload:
172  return "message_payload";
173  case endpoint:
174  return "endpoint";
175  case debug_handshake:
176  return "debug_handshake";
177  case debug_close:
178  return "debug_close";
179  case devel:
180  return "devel";
181  case app:
182  return "application";
183  default:
184  return "unknown";
185  }
186  }
187 };
188 
189 } // logger
190 } // websocketpp
191 
192 #endif //WEBSOCKETPP_LOGGER_LEVELS_HPP
static level const all
Special aggregate value representing "all levels".
Definition: levels.hpp:145
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 control
One line per control frame.
Definition: levels.hpp:125
static level const app
Special channel for application specific logs. Not used by the library.
Definition: levels.hpp:143
uint32_t value
Type of a channel type hint value.
Definition: levels.hpp:48
static value const access
Access log.
Definition: levels.hpp:53
static level const frame_payload
One line per frame, includes the full message payload (warning: chatty)
Definition: levels.hpp:129
static level const devel
Low level debugging information (warning: very chatty)
Definition: levels.hpp:63
static level const message_payload
Reserved.
Definition: levels.hpp:133
static level const frame_header
One line per frame, includes the full frame header.
Definition: levels.hpp:127
Package of log levels for logging access events.
Definition: levels.hpp:112
static level const devel
Development messages (warning: very chatty)
Definition: levels.hpp:141
static level const disconnect
One line for each closed connection. Includes closing codes and reasons.
Definition: levels.hpp:123
Package of values for hinting at the nature of a given logger.
Definition: levels.hpp:46
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 value const error
Error log.
Definition: levels.hpp:55
static level const info
Definition: levels.hpp:69
Namespace for the WebSocket++ project.
Definition: base64.hpp:41
Creates and manages connections associated with a WebSocket endpoint.
Definition: endpoint.hpp:41
static level const message_header
Reserved.
Definition: levels.hpp:131
static char const * channel_name(level channel)
Get the textual name of a channel given a channel id.
Definition: levels.hpp:91
static value const none
No information.
Definition: levels.hpp:51
Package of log levels for logging errors.
Definition: levels.hpp:59
static level const debug_close
Extra information about closing handshakes.
Definition: levels.hpp:139
static char const * channel_name(level channel)
Get the textual name of a channel given a channel id.
Definition: levels.hpp:157
static level const all
Special aggregate value representing "all levels".
Definition: levels.hpp:80
static level const library
Definition: levels.hpp:66
static level const rerror
Definition: levels.hpp:75
static level const warn
Definition: levels.hpp:72
static level const connect
Information about new connections.
Definition: levels.hpp:121