diff --git a/lib/core/context.c b/lib/core/context.c index ab6afa382..fb684e511 100644 --- a/lib/core/context.c +++ b/lib/core/context.c @@ -782,7 +782,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 @@ -1402,7 +1402,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; } } @@ -1991,7 +1991,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; } @@ -2223,7 +2223,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); } diff --git a/lib/core/logs.c b/lib/core/logs.c index 377dcb08a..a13c84194 100644 --- a/lib/core/logs.c +++ b/lib/core/logs.c @@ -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 diff --git a/lib/tls/tls-network.c b/lib/tls/tls-network.c index b2038d537..ef404aff7 100644 --- a/lib/tls/tls-network.c +++ b/lib/tls/tls-network.c @@ -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); @@ -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;