From be77f764e296d18f9d463adbddf3950a5a316010 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Thu, 23 Mar 2017 14:18:37 +0000 Subject: Improve content logging with content IDs (pointer values). This makes it easier to track a content by its ID through a log. --- content/content.c | 2 +- render/html.c | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/content/content.c b/content/content.c index 70df87e14..7a8bb013f 100644 --- a/content/content.c +++ b/content/content.c @@ -757,7 +757,7 @@ void content_broadcast(struct content *c, content_msg msg, { struct content_user *user, *next; assert(c); -// LOG("%p %s -> %d", c, c->url, msg); +// LOG("%p -> msg:%d", c, msg); for (user = c->user_list->next; user != 0; user = next) { next = user->next; /* user may be destroyed during callback */ if (user->callback != 0) diff --git a/render/html.c b/render/html.c index 6f7ad6249..544b7b61a 100644 --- a/render/html.c +++ b/render/html.c @@ -686,8 +686,9 @@ dom_default_action_DOMNodeInserted_cb(struct dom_event *evt, void *pw) content_broadcast(&htmlc->base, CONTENT_MSG_GETCTX, msg_data); - LOG("javascript context: %p", - htmlc->jscontext); + LOG("javascript context: %p (htmlc: %p)", + htmlc->jscontext, + htmlc); } if (htmlc->jscontext != NULL) { js_handle_new_element(htmlc->jscontext, @@ -1142,7 +1143,7 @@ static bool html_convert(struct content *c) } htmlc->base.active--; /* the html fetch is no longer active */ - LOG("%d fetches active", htmlc->base.active); + LOG("%d fetches active (%p)", htmlc->base.active, c); /* The parse cannot be completed here because it may be paused * untill all the resources being fetched have completed. @@ -1195,7 +1196,7 @@ html_begin_conversion(html_content *htmlc) * complete to avoid repeating the completion pointlessly. */ if (htmlc->parse_completed == false) { - LOG("Completing parse"); + LOG("Completing parse (%p)", htmlc); /* complete parsing */ error = dom_hubbub_parser_completed(htmlc->parser); if (error != DOM_HUBBUB_OK) { @@ -1210,12 +1211,15 @@ html_begin_conversion(html_content *htmlc) } if (html_can_begin_conversion(htmlc) == false) { + LOG("Can't begin conversion (%p)", htmlc); /* We can't proceed (see commentary above) */ return true; } /* Give up processing if we've been aborted */ if (htmlc->aborted) { + LOG("Conversion aborted (%p) (active: %u)", htmlc, + htmlc->base.active); content_broadcast_errorcode(&htmlc->base, NSERROR_STOPPED); return false; } @@ -1366,7 +1370,7 @@ static void html_stop(struct content *c) break; default: - LOG("Unexpected status %d", c->status); + LOG("Unexpected status %d (%p)", c->status, c); assert(0); } } -- cgit v1.2.3