mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
logging: move most everything during startup to info
This commit is contained in:
parent
217dfe7c6b
commit
d1859ad4fd
9 changed files with 41 additions and 38 deletions
|
@ -166,7 +166,8 @@ lws_protocol_init(struct lws_context *context)
|
|||
pvo = pvo1->options;
|
||||
|
||||
while (pvo) {
|
||||
lwsl_notice(" vh %s prot %s opt %s\n",
|
||||
lwsl_notice(
|
||||
" vhost \"%s\", protocol \"%s\", option \"%s\"\n",
|
||||
vh->name,
|
||||
vh->protocols[n].name,
|
||||
pvo->name);
|
||||
|
@ -758,19 +759,19 @@ lws_create_context(struct lws_context_creation_info *info)
|
|||
struct rlimit rt;
|
||||
#endif
|
||||
|
||||
lwsl_notice("Initial logging level %d\n", log_level);
|
||||
lwsl_notice("Libwebsockets version: %s\n", library_version);
|
||||
lwsl_info("Initial logging level %d\n", log_level);
|
||||
lwsl_info("Libwebsockets version: %s\n", library_version);
|
||||
#if defined(GCC_VER)
|
||||
lwsl_notice("Compiled with %s\n", GCC_VER);
|
||||
lwsl_info("Compiled with %s\n", GCC_VER);
|
||||
#endif
|
||||
#if LWS_POSIX
|
||||
#ifdef LWS_USE_IPV6
|
||||
if (!lws_check_opt(info->options, LWS_SERVER_OPTION_DISABLE_IPV6))
|
||||
lwsl_notice("IPV6 compiled in and enabled\n");
|
||||
lwsl_info("IPV6 compiled in and enabled\n");
|
||||
else
|
||||
lwsl_notice("IPV6 compiled in but disabled\n");
|
||||
lwsl_info("IPV6 compiled in but disabled\n");
|
||||
#else
|
||||
lwsl_notice("IPV6 not compiled in\n");
|
||||
lwsl_info("IPV6 not compiled in\n");
|
||||
#endif
|
||||
#if !defined(LWS_PLAT_OPTEE) && !defined(LWS_PLAT_ESP32)
|
||||
lws_feature_status_libev(info);
|
||||
|
@ -783,7 +784,7 @@ lws_create_context(struct lws_context_creation_info *info)
|
|||
lwsl_info(" SPEC_LATEST_SUPPORTED : %u\n", SPEC_LATEST_SUPPORTED);
|
||||
lwsl_info(" sizeof (*info) : %ld\n", (long)sizeof(*info));
|
||||
#if defined(LWS_WITH_STATS)
|
||||
lwsl_notice(" LWS_WITH_STATS : on\n");
|
||||
lwsl_info(" LWS_WITH_STATS : on\n");
|
||||
#endif
|
||||
#if LWS_POSIX
|
||||
lwsl_info(" SYSTEM_RANDOM_FILEPATH: '%s'\n", SYSTEM_RANDOM_FILEPATH);
|
||||
|
@ -852,7 +853,7 @@ lws_create_context(struct lws_context_creation_info *info)
|
|||
#ifndef LWS_NO_DAEMONIZE
|
||||
if (pid_daemon) {
|
||||
context->started_with_parent = pid_daemon;
|
||||
lwsl_notice(" Started with daemon pid %d\n", pid_daemon);
|
||||
lwsl_info(" Started with daemon pid %d\n", pid_daemon);
|
||||
}
|
||||
#endif
|
||||
#if defined(__ANDROID__)
|
||||
|
@ -938,7 +939,7 @@ lws_create_context(struct lws_context_creation_info *info)
|
|||
context->fd_limit_per_thread = context->max_fds /
|
||||
context->count_threads;
|
||||
|
||||
lwsl_notice(" Threads: %d each %d fds\n", context->count_threads,
|
||||
lwsl_info(" Threads: %d each %d fds\n", context->count_threads,
|
||||
context->fd_limit_per_thread);
|
||||
|
||||
if (!info->ka_interval && info->ka_time > 0) {
|
||||
|
@ -1046,7 +1047,7 @@ lws_create_context(struct lws_context_creation_info *info)
|
|||
|
||||
lws_context_init_extensions(info, context);
|
||||
|
||||
lwsl_notice(" mem: per-conn: %5lu bytes + protocol rx buf\n",
|
||||
lwsl_info(" mem: per-conn: %5lu bytes + protocol rx buf\n",
|
||||
(unsigned long)sizeof(struct lws));
|
||||
|
||||
strcpy(context->canonical_hostname, "unknown");
|
||||
|
@ -1148,7 +1149,7 @@ lws_vhost_destroy1(struct lws_vhost *vh)
|
|||
struct lws_context *context = vh->context;
|
||||
struct lws wsi;
|
||||
|
||||
lwsl_notice("%s\n", __func__);
|
||||
lwsl_info("%s\n", __func__);
|
||||
|
||||
if (vh->being_destroyed)
|
||||
return;
|
||||
|
@ -1255,7 +1256,7 @@ lws_vhost_destroy2(struct lws_vhost *vh)
|
|||
struct lws_deferred_free *df;
|
||||
int n;
|
||||
|
||||
lwsl_notice("%s: %p\n", __func__, vh);
|
||||
lwsl_info("%s: %p\n", __func__, vh);
|
||||
|
||||
/* if we are still on deferred free list, remove ourselves */
|
||||
|
||||
|
@ -1326,7 +1327,7 @@ lws_vhost_destroy2(struct lws_vhost *vh)
|
|||
* they do not refer to the vhost. So it's safe to free.
|
||||
*/
|
||||
|
||||
lwsl_notice(" %s: Freeing vhost %p\n", __func__, vh);
|
||||
lwsl_info(" %s: Freeing vhost %p\n", __func__, vh);
|
||||
|
||||
memset(vh, 0, sizeof(*vh));
|
||||
lws_free(vh);
|
||||
|
@ -1388,7 +1389,7 @@ lws_context_destroy(struct lws_context *context)
|
|||
return;
|
||||
}
|
||||
|
||||
lwsl_notice("%s: ctx %p\n", __func__, context);
|
||||
lwsl_info("%s: ctx %p\n", __func__, context);
|
||||
|
||||
m = context->count_threads;
|
||||
context->being_destroyed = 1;
|
||||
|
@ -1476,7 +1477,7 @@ lws_context_destroy2(struct lws_context *context)
|
|||
uint32_t n;
|
||||
#endif
|
||||
|
||||
lwsl_notice("%s: ctx %p\n", __func__, context);
|
||||
lwsl_info("%s: ctx %p\n", __func__, context);
|
||||
|
||||
/*
|
||||
* free all the per-vhost allocations
|
||||
|
|
|
@ -24,9 +24,9 @@
|
|||
void lws_feature_status_libev(struct lws_context_creation_info *info)
|
||||
{
|
||||
if (lws_check_opt(info->options, LWS_SERVER_OPTION_LIBEV))
|
||||
lwsl_notice("libev support compiled in and enabled\n");
|
||||
lwsl_info("libev support compiled in and enabled\n");
|
||||
else
|
||||
lwsl_notice("libev support compiled in but disabled\n");
|
||||
lwsl_info("libev support compiled in but disabled\n");
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -79,7 +79,7 @@ lws_ev_initloop(struct lws_context *context, struct ev_loop *loop, int tsi)
|
|||
struct ev_signal *w_sigint = &context->pt[tsi].w_sigint.ev_watcher;
|
||||
struct ev_io *w_accept = &context->pt[tsi].w_accept.ev_watcher;
|
||||
struct lws_vhost *vh = context->vhost_list;
|
||||
const char * backend_name;
|
||||
const char *backend_name;
|
||||
int status = 0;
|
||||
int backend;
|
||||
|
||||
|
@ -135,7 +135,8 @@ lws_ev_initloop(struct lws_context *context, struct ev_loop *loop, int tsi)
|
|||
break;
|
||||
}
|
||||
|
||||
lwsl_notice(" libev backend: %s\n", backend_name);
|
||||
lwsl_info(" libev backend: %s\n", backend_name);
|
||||
(void)backend_name;
|
||||
|
||||
return status;
|
||||
}
|
||||
|
|
|
@ -24,9 +24,9 @@
|
|||
void lws_feature_status_libevent(struct lws_context_creation_info *info)
|
||||
{
|
||||
if (lws_check_opt(info->options, LWS_SERVER_OPTION_LIBEVENT))
|
||||
lwsl_notice("libevent support compiled in and enabled\n");
|
||||
lwsl_info("libevent support compiled in and enabled\n");
|
||||
else
|
||||
lwsl_notice("libevent support compiled in but disabled\n");
|
||||
lwsl_info("libevent support compiled in but disabled\n");
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -25,9 +25,9 @@ void
|
|||
lws_feature_status_libuv(struct lws_context_creation_info *info)
|
||||
{
|
||||
if (lws_check_opt(info->options, LWS_SERVER_OPTION_LIBUV))
|
||||
lwsl_notice("libuv support compiled in and enabled\n");
|
||||
lwsl_info("libuv support compiled in and enabled\n");
|
||||
else
|
||||
lwsl_notice("libuv support compiled in but disabled\n");
|
||||
lwsl_info("libuv support compiled in but disabled\n");
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -2702,7 +2702,8 @@ lws_cgi(struct lws *wsi, const char * const *exec_array, int script_uri_path_len
|
|||
#if defined(__linux__)
|
||||
prctl(PR_SET_PDEATHSIG, SIGTERM);
|
||||
#endif
|
||||
setpgrp(); /* stops on-daemonized main processess getting SIGINT from TTY */
|
||||
if (script_uri_path_len >= 0)
|
||||
setpgrp(); /* stops on-daemonized main processess getting SIGINT from TTY */
|
||||
|
||||
if (cgi->pid) {
|
||||
/* we are the parent process */
|
||||
|
|
|
@ -788,7 +788,7 @@ lws_plat_init(struct lws_context *context,
|
|||
return 1;
|
||||
}
|
||||
|
||||
lwsl_notice(" mem: platform fd map: %5lu bytes\n",
|
||||
lwsl_info(" mem: platform fd map: %5lu bytes\n",
|
||||
(unsigned long)(sizeof(struct lws *) * context->max_fds));
|
||||
fd = open(SYSTEM_RANDOM_FILEPATH, O_RDONLY);
|
||||
|
||||
|
|
|
@ -1161,7 +1161,7 @@ LWS_EXTERN void lws_feature_status_libev(struct lws_context_creation_info *info)
|
|||
#define LWS_LIBEV_ENABLED(context) (0)
|
||||
#if LWS_POSIX && !defined(LWS_WITH_ESP32)
|
||||
#define lws_feature_status_libev(_a) \
|
||||
lwsl_notice("libev support not compiled in\n")
|
||||
lwsl_info("libev support not compiled in\n")
|
||||
#else
|
||||
#define lws_feature_status_libev(_a)
|
||||
#endif
|
||||
|
|
|
@ -212,10 +212,10 @@ lws_context_init_server(struct lws_context_creation_info *info,
|
|||
if (!lws_check_opt(info->options, LWS_SERVER_OPTION_EXPLICIT_VHOSTS)) {
|
||||
#ifdef LWS_USE_UNIX_SOCK
|
||||
if (LWS_UNIX_SOCK_ENABLED(vhost))
|
||||
lwsl_notice(" Listening on \"%s\"\n", info->iface);
|
||||
lwsl_info(" Listening on \"%s\"\n", info->iface);
|
||||
else
|
||||
#endif
|
||||
lwsl_notice(" Listening on port %d\n", info->port);
|
||||
lwsl_info(" Listening on port %d\n", info->port);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -2341,7 +2341,7 @@ lws_adopt_descriptor_vhost(struct lws_vhost *vh, lws_adoption_type type,
|
|||
}
|
||||
} else
|
||||
if (lws_server_socket_service_ssl(new_wsi, fd.sockfd)) {
|
||||
lwsl_err("%s: fail ssl negotiation\n", __func__);
|
||||
lwsl_info("%s: fail ssl negotiation\n", __func__);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -3132,7 +3132,7 @@ lws_server_get_canonical_hostname(struct lws_context *context,
|
|||
gethostname((char *)context->canonical_hostname,
|
||||
sizeof(context->canonical_hostname) - 1);
|
||||
|
||||
lwsl_notice(" canonical_hostname = %s\n", context->canonical_hostname);
|
||||
lwsl_info(" canonical_hostname = %s\n", context->canonical_hostname);
|
||||
#else
|
||||
(void)context;
|
||||
#endif
|
||||
|
|
14
lib/ssl.c
14
lib/ssl.c
|
@ -296,29 +296,29 @@ lws_context_init_ssl_library(struct lws_context_creation_info *info)
|
|||
{
|
||||
#ifdef USE_WOLFSSL
|
||||
#ifdef USE_OLD_CYASSL
|
||||
lwsl_notice(" Compiled with CyaSSL support\n");
|
||||
lwsl_info(" Compiled with CyaSSL support\n");
|
||||
#else
|
||||
lwsl_notice(" Compiled with wolfSSL support\n");
|
||||
lwsl_info(" Compiled with wolfSSL support\n");
|
||||
#endif
|
||||
#else
|
||||
#if defined(LWS_USE_BORINGSSL)
|
||||
lwsl_notice(" Compiled with BoringSSL support\n");
|
||||
lwsl_info(" Compiled with BoringSSL support\n");
|
||||
#else
|
||||
#if defined(LWS_USE_MBEDTLS)
|
||||
lwsl_notice(" Compiled with MbedTLS support\n");
|
||||
lwsl_info(" Compiled with MbedTLS support\n");
|
||||
#else
|
||||
lwsl_notice(" Compiled with OpenSSL support\n");
|
||||
lwsl_info(" Compiled with OpenSSL support\n");
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
if (!lws_check_opt(info->options, LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT)) {
|
||||
lwsl_notice(" SSL disabled: no LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT\n");
|
||||
lwsl_info(" SSL disabled: no LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* basic openssl init */
|
||||
|
||||
lwsl_notice("Doing SSL library init\n");
|
||||
lwsl_info("Doing SSL library init\n");
|
||||
|
||||
#if !defined(LWS_USE_MBEDTLS)
|
||||
SSL_library_init();
|
||||
|
|
Loading…
Add table
Reference in a new issue