1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

add lwsl_notice

Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
Andy Green 2013-01-19 12:18:07 +08:00
parent 0b31909cce
commit 7c19c34f9a
4 changed files with 22 additions and 18 deletions

View file

@ -84,7 +84,7 @@ There are several other possible configure options
--without-daemonize Don't build daemonize.c / lws_daemonize
--disable-debug Remove all debug logging below lwsl_warn in severity
--disable-debug Remove all debug logging below lwsl_notice in severity
from the code -- it's not just defeated from logging
but removed from compilation
@ -399,11 +399,11 @@ libwebsockets-test-client someserver.com
debug logging
-------------
By default logging of severity "warn" or "err" is enabled to stderr.
By default logging of severity "notice", "warn" or "err" is enabled to stderr.
Again by default other logging is comiled in but disabled from printing.
If you want to eliminate the debug logging below warn in severity, use the
If you want to eliminate the debug logging below notice in severity, use the
--disable-debug configure option to have it removed from the code by the
preprocesser.
@ -414,12 +414,13 @@ available are (OR together the numbers to select multiple)
1 ERR
2 WARN
4 INFO
8 DEBUG
16 PARSER
32 HEADER
64 EXTENSION
128 CLIENT
4 NOTICE
8 INFO
16 DEBUG
32 PARSER
64 HEADER
128 EXTENSION
256 CLIENT
Also using lws_set_log_level api you may provide a custom callback to actually
emit the log string. By default, this points to an internal emit function

View file

@ -47,12 +47,13 @@ int openssl_websocket_private_data_index;
#endif
#endif
static int log_level = LLL_ERR | LLL_WARN;
static int log_level = LLL_ERR | LLL_WARN | LLL_NOTICE;
static void lwsl_emit_stderr(const char *line);
static void (*lwsl_emit)(const char *line) = lwsl_emit_stderr;
static const char *log_level_names[] = {
"ERR",
"WARN",
"NOTICE",
"INFO",
"DEBUG",
"PARSER",

View file

@ -69,14 +69,15 @@ typedef int ssize_t;
enum lws_log_levels {
LLL_ERR = 1 << 0,
LLL_WARN = 1 << 1,
LLL_INFO = 1 << 2,
LLL_DEBUG = 1 << 3,
LLL_PARSER = 1 << 4,
LLL_HEADER = 1 << 5,
LLL_EXT = 1 << 6,
LLL_CLIENT = 1 << 7,
LLL_NOTICE = 1 << 2,
LLL_INFO = 1 << 3,
LLL_DEBUG = 1 << 4,
LLL_PARSER = 1 << 5,
LLL_HEADER = 1 << 6,
LLL_EXT = 1 << 7,
LLL_CLIENT = 1 << 8,
LLL_COUNT = 8 /* set to count of valid flags */
LLL_COUNT = 9 /* set to count of valid flags */
};
enum libwebsocket_context_options {

View file

@ -83,7 +83,8 @@
extern void _lws_log(int filter, const char *format, ...);
/* warn and log are always compiled in */
/* notice, warn and log are always compiled in */
#define lwsl_notice(...) _lws_log(LLL_NOTICE, __VA_ARGS__)
#define lwsl_warn(...) _lws_log(LLL_WARN, __VA_ARGS__)
#define lwsl_err(...) _lws_log(LLL_ERR, __VA_ARGS__)