update bindings with logging changes

This commit is contained in:
Vincent Sanders 2017-09-03 23:19:11 +01:00
parent 9e81082355
commit 63f5ba6f62
6 changed files with 23 additions and 18 deletions

View File

@ -34,7 +34,7 @@ write_log_entry(duk_context *ctx, unsigned int group, char logtype)
/* spcs... pfx strs... */ /* spcs... pfx strs... */
duk_concat(ctx, duk_get_top(ctx)); duk_concat(ctx, duk_get_top(ctx));
/* str */ /* str */
LOG("%s", duk_safe_to_string(ctx, 0)); NSLOG(netsurf, INFO, "%s", duk_safe_to_string(ctx, 0));
} }
%}; %};

View File

@ -41,11 +41,12 @@ method Document::write()
corestring_dom___ns_key_html_content_data, corestring_dom___ns_key_html_content_data,
&htmlc); &htmlc);
if ((err != DOM_NO_ERR) || (htmlc == NULL)) { if ((err != DOM_NO_ERR) || (htmlc == NULL)) {
LOG("error getting htmlc. parent node:%p htmlc:%p", NSLOG(netsurf, INFO,
"error getting htmlc. parent node:%p htmlc:%p",
priv->parent.node, htmlc); priv->parent.node, htmlc);
return 0; return 0;
} else if (htmlc->parser == NULL) { } else if (htmlc->parser == NULL) {
LOG("error; no parser for htmlc: %p", htmlc); NSLOG(netsurf, INFO, "error; no parser for htmlc: %p", htmlc);
return 0; return 0;
} }
@ -74,11 +75,12 @@ method Document::writeln()
corestring_dom___ns_key_html_content_data, corestring_dom___ns_key_html_content_data,
&htmlc); &htmlc);
if ((err != DOM_NO_ERR) || (htmlc == NULL)) { if ((err != DOM_NO_ERR) || (htmlc == NULL)) {
LOG("error getting htmlc. parent node:%p htmlc:%p", NSLOG(netsurf, INFO,
"error getting htmlc. parent node:%p htmlc:%p",
priv->parent.node, htmlc); priv->parent.node, htmlc);
return 0; return 0;
} else if (htmlc->parser == NULL) { } else if (htmlc->parser == NULL) {
LOG("error; no parser for htmlc: %p", htmlc); NSLOG(netsurf, INFO, "error; no parser for htmlc: %p", htmlc);
return 0; return 0;
} }
@ -311,7 +313,8 @@ getter Document::cookie()
return 1; return 1;
} }
} else { } else {
LOG("error getting htmlc. parent node:%p htmlc:%p", NSLOG(netsurf, INFO,
"error getting htmlc. parent node:%p htmlc:%p",
priv->parent.node, htmlc); priv->parent.node, htmlc);
} }
return 0; return 0;

View File

@ -183,7 +183,7 @@ getter Element::childElementCount()
element = NULL; element = NULL;
} }
} }
LOG("I found %u of them", jsret); NSLOG(netsurf, INFO, "I found %u of them", jsret);
duk_push_uint(ctx, jsret); duk_push_uint(ctx, jsret);
return 1; return 1;
%} %}

View File

@ -173,7 +173,8 @@ method EventTarget::addEventListener()
exc = dom_string_create((const uint8_t*)ev_ty, ev_ty_l, exc = dom_string_create((const uint8_t*)ev_ty, ev_ty_l,
&ev_ty_s); &ev_ty_s);
if (exc != DOM_NO_ERR) { if (exc != DOM_NO_ERR) {
LOG("Oh dear, failed to create dom_string in addEventListener()"); NSLOG(netsurf, INFO,
"Oh dear, failed to create dom_string in addEventListener()");
return 0; return 0;
} }
dukky_register_event_listener_for( dukky_register_event_listener_for(

View File

@ -40,7 +40,7 @@ method Location::reload()
if (priv_win->win != NULL) { if (priv_win->win != NULL) {
browser_window_reload(priv_win->win, false); browser_window_reload(priv_win->win, false);
} else { } else {
LOG("failed to get browser context"); NSLOG(netsurf, INFO, "failed to get browser context");
} }
return 0; return 0;
%} %}
@ -54,7 +54,7 @@ method Location::assign()
duk_pop(ctx); duk_pop(ctx);
if (priv_win == NULL || priv_win->win == NULL) { if (priv_win == NULL || priv_win->win == NULL) {
LOG("failed to get browser context"); NSLOG(netsurf, INFO, "failed to get browser context");
return 0; return 0;
} }
@ -83,7 +83,7 @@ method Location::replace()
duk_pop(ctx); duk_pop(ctx);
if (priv_win == NULL || priv_win->win == NULL) { if (priv_win == NULL || priv_win->win == NULL) {
LOG("failed to get browser context"); NSLOG(netsurf, INFO, "failed to get browser context");
return 0; return 0;
} }
@ -131,7 +131,7 @@ setter Location::href()
duk_pop(ctx); duk_pop(ctx);
if (priv_win == NULL || priv_win->win == NULL) { if (priv_win == NULL || priv_win->win == NULL) {
LOG("failed to get browser context"); NSLOG(netsurf, INFO, "failed to get browser context");
return 0; return 0;
} }

View File

@ -25,9 +25,10 @@ init Window(struct browser_window *win, struct html_content *htmlc)
/* element window */ /* element window */
priv->win = win; priv->win = win;
priv->htmlc = htmlc; priv->htmlc = htmlc;
LOG("win=%p htmlc=%p", priv->win, priv->htmlc); NSLOG(netsurf, INFO, "win=%p htmlc=%p", priv->win, priv->htmlc);
LOG("URL is %s", nsurl_access(browser_window_get_url(priv->win))); NSLOG(netsurf, INFO,
"URL is %s", nsurl_access(browser_window_get_url(priv->win)));
%} %}
prototype Window() prototype Window()
@ -138,6 +139,6 @@ method Window::alert()
%{ %{
duk_size_t msg_len; duk_size_t msg_len;
const char *msg = duk_safe_to_lstring(ctx, 0, &msg_len); const char *msg = duk_safe_to_lstring(ctx, 0, &msg_len);
LOG("JS ALERT: %*s", (int)msg_len, msg); NSLOG(netsurf, INFO, "JS ALERT: %*s", (int)msg_len, msg);
return 0; return 0;
%} %}