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

logs: migrate more to log context

This commit is contained in:
Felipe Gasper 2021-10-15 08:44:57 -04:00 committed by Andy Green
parent 80b0c59ad6
commit 81830a3979
3 changed files with 14 additions and 16 deletions

View file

@ -783,7 +783,7 @@ lws_create_context(const struct lws_context_creation_info *info)
#endif /* network */
lwsl_notice("LWS: %s, %s%s\n", library_version, opts_str, s);
lwsl_cx_notice(context, "LWS: %s, %s%s", library_version, opts_str, s);
#if defined(LWS_WITH_NETWORK)
lwsl_cx_info(context, "Event loop: %s", plev->ops->name);
#endif
@ -1412,7 +1412,7 @@ lws_create_context(const struct lws_context_creation_info *info)
context->l1 = lws_cache_create(&ci);
if (!context->l1) {
lwsl_err("Failed to init cookiejar");
lwsl_cx_err(context, "Failed to init cookiejar");
goto bail;
}
}
@ -2001,7 +2001,7 @@ next:
vh = context->vhost_list;
while (vh) {
vh1 = vh->vhost_next;
// lwsl_debug("%s: vh %s destroy2\n", __func__, vh->name);
// lwsl_vhost_debug(vh, "vh %s destroy2", vh->name);
__lws_vhost_destroy2(vh);
vh = vh1;
}
@ -2231,7 +2231,7 @@ next:
#if defined(LWS_WITH_NETWORK)
bail:
#endif
lwsl_info("%s: leaving\n", __func__);
lwsl_cx_info(context, "leaving");
context->inside_context_destroy = 0;
lws_context_unlock(context);
}

View file

@ -124,7 +124,7 @@ __lws_lc_tag(struct lws_context *context, lws_lifecycle_group_t *grp,
lwsl_refcount_cx(lc->log_cx, 1);
#if defined(LWS_LOG_TAG_LIFECYCLE)
lwsl_notice(" ++ %s (%d)\n", lc->gutag, (int)grp->owner.count);
lwsl_cx_notice(context, " ++ %s (%d)", lc->gutag, (int)grp->owner.count);
#endif
}
@ -166,13 +166,13 @@ __lws_lc_untag(struct lws_context *context, lws_lifecycle_t *lc)
char buf[24];
if (!lc->gutag[0]) { /* we never tagged this object... */
lwsl_err("%s: %s never tagged\n", __func__, lc->gutag);
lwsl_cx_err(context, "%s never tagged", lc->gutag);
assert(0);
return;
}
if (!lc->list.owner) { /* we already untagged this object... */
lwsl_err("%s: %s untagged twice\n", __func__, lc->gutag);
lwsl_cx_err(context, "%s untagged twice", lc->gutag);
assert(0);
return;
}
@ -184,7 +184,7 @@ __lws_lc_untag(struct lws_context *context, lws_lifecycle_t *lc)
humanize_schema_us);
#if defined(LWS_LOG_TAG_LIFECYCLE)
lwsl_notice(" -- %s (%d) %s", lc->gutag,
lwsl_cx_notice(context, " -- %s (%d) %s", lc->gutag,
(int)lc->list.owner->count - 1, buf);
#endif

View file

@ -90,10 +90,10 @@ lws_tls_check_cert_lifetime(struct lws_vhost *v)
return 1;
life = (ir.time - now) / (24 * 3600);
lwsl_notice(" vhost %s: cert expiry: %dd\n", v->name,
lwsl_vhost_notice(v, " vhost %s: cert expiry: %dd", v->name,
(int)life);
} else
lwsl_info(" vhost %s: no cert\n", v->name);
lwsl_vhost_info(v, " vhost %s: no cert", v->name);
memset(&caa, 0, sizeof(caa));
caa.vh = v;
@ -151,7 +151,7 @@ lws_tls_generic_cert_checks(struct lws_vhost *vhost, const char *cert,
if ((n == LWS_TLS_EXTANT_NO || m == LWS_TLS_EXTANT_NO) &&
(vhost->options & LWS_SERVER_OPTION_IGNORE_MISSING_CERT)) {
lwsl_notice("Ignoring missing %s or %s\n", cert, private_key);
lwsl_vhost_notice(vhost, "Ignoring missing %s or %s", cert, private_key);
vhost->tls.skipped_certs = 1;
return LWS_TLS_EXTANT_NO;
@ -188,8 +188,7 @@ lws_tls_cert_updated(struct lws_context *context, const char *certpath,
mem_privkey, len_mem_privkey);
if (v->tls.skipped_certs)
lwsl_notice("%s: vhost %s: cert unset\n",
__func__, v->name);
lwsl_vhost_notice(v, "vhost %s: cert unset", v->name);
}
} lws_end_foreach_ll(v, vhost_next);
@ -204,7 +203,7 @@ lws_gate_accepts(struct lws_context *context, int on)
if (context->tls_gate_accepts == (char)on)
return 0;
lwsl_notice("%s: on = %d\n", __func__, on);
lwsl_cx_notice(context, "on = %d", on);
context->tls_gate_accepts = (char)on;
@ -217,8 +216,7 @@ lws_gate_accepts(struct lws_context *context, int on)
if (v->tls.use_ssl &&
lws_change_pollfd(wsi, on ? LWS_POLLIN : 0,
on ? 0 : LWS_POLLIN))
lwsl_notice("%s: Unable to set POLLIN %d\n",
__func__, on);
lwsl_cx_notice(context, "Unable to set POLLIN %d", on);
} lws_end_foreach_dll(d);
v = v->vhost_next;