websocketpp  0.3.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) 2013, 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 struct elevel {
42  static level const none = 0x0;
44  static level const devel = 0x1;
47  static level const library = 0x2;
50  static level const info = 0x4;
53  static level const warn = 0x8;
56  static level const rerror = 0x10;
59  static level const fatal = 0x20;
61  static level const all = 0xffffffff;
62 
64 
72  static char const * channel_name(level channel) {
73  switch(channel) {
74  case devel:
75  return "devel";
76  case library:
77  return "library";
78  case info:
79  return "info";
80  case warn:
81  return "warning";
82  case rerror:
83  return "error";
84  case fatal:
85  return "fatal";
86  default:
87  return "unknown";
88  }
89  }
90 };
91 
93 struct alevel {
95  static level const none = 0x0;
97 
102  static level const connect = 0x1;
104  static level const disconnect = 0x2;
106  static level const control = 0x4;
108  static level const frame_header = 0x8;
110  static level const frame_payload = 0x10;
112  static level const message_header = 0x20;
114  static level const message_payload = 0x40;
116  static level const endpoint = 0x80;
118  static level const debug_handshake = 0x100;
120  static level const debug_close = 0x200;
122  static level const devel = 0x400;
124  static level const app = 0x800;
126  static level const all = 0xffffffff;
127 
129 
138  static char const * channel_name(level channel) {
139  switch(channel) {
140  case connect:
141  return "connect";
142  case disconnect:
143  return "disconnect";
144  case control:
145  return "control";
146  case frame_header:
147  return "frame_header";
148  case frame_payload:
149  return "frame_payload";
150  case message_header:
151  return "message_header";
152  case message_payload:
153  return "message_payload";
154  case endpoint:
155  return "endpoint";
156  case debug_handshake:
157  return "debug_handshake";
158  case debug_close:
159  return "debug_close";
160  case devel:
161  return "devel";
162  case app:
163  return "application";
164  default:
165  return "unknown";
166  }
167  }
168 };
169 
170 } // logger
171 } // websocketpp
172 
173 #endif //WEBSOCKETPP_LOGGER_LEVELS_HPP
static level const all
Special aggregate value representing "all levels".
Definition: levels.hpp:126
static level const fatal
Definition: levels.hpp:59
static level const none
Special aggregate value representing "no levels".
Definition: levels.hpp:42
static level const control
One line per control frame.
Definition: levels.hpp:106
static level const app
Special channel for application specific logs. Not used by the library.
Definition: levels.hpp:124
static level const frame_payload
One line per frame, includes the full message payload (warning: chatty)
Definition: levels.hpp:110
static level const devel
Low level debugging information (warning: very chatty)
Definition: levels.hpp:44
static level const message_payload
Reserved.
Definition: levels.hpp:114
static level const frame_header
One line per frame, includes the full frame header.
Definition: levels.hpp:108
Package of log levels for logging access events.
Definition: levels.hpp:93
static level const devel
Development messages (warning: very chatty)
Definition: levels.hpp:122
static level const disconnect
One line for each closed connection. Includes closing codes and reasons.
Definition: levels.hpp:104
static level const none
Special aggregate value representing "no levels".
Definition: levels.hpp:95
static level const debug_handshake
Extra information about opening handshakes.
Definition: levels.hpp:118
static level const info
Definition: levels.hpp:50
Namespace for the WebSocket++ project.
Definition: base64.hpp:41
Creates and manages connections associated with a WebSocket endpoint.
Definition: endpoint.hpp:42
static level const message_header
Reserved.
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:72
Package of log levels for logging errors.
Definition: levels.hpp:40
static level const debug_close
Extra information about closing handshakes.
Definition: levels.hpp:120
static char const * channel_name(level channel)
Get the textual name of a channel given a channel id.
Definition: levels.hpp:138
static level const all
Special aggregate value representing "all levels".
Definition: levels.hpp:61
static level const library
Definition: levels.hpp:47
static level const rerror
Definition: levels.hpp:56
static level const warn
Definition: levels.hpp:53
static level const connect
Information about new connections.
Definition: levels.hpp:102