diff options
author | Vincent Sanders <vince@kyllikki.org> | 2017-09-06 18:28:12 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2017-09-06 18:45:27 +0100 |
commit | 75018632a9b953aafeae6f4e8aea607fd1d89dca (patch) | |
tree | d661d2fded2ad4b80c4cf019dee2954c052ab090 /desktop/hotlist.c | |
parent | 8d9b2efc11529da8cb5870b39ff15249c648b10a (diff) | |
download | netsurf-75018632a9b953aafeae6f4e8aea607fd1d89dca.tar.gz netsurf-75018632a9b953aafeae6f4e8aea607fd1d89dca.tar.bz2 |
Use coccinelle to change logging macro calls in c files
for F in $(git ls-files '*.c');do spatch --sp-file foo.cocci --in-place ${F};done
@@ expression E; @@
-LOG(E);
+NSLOG(netsurf, INFO, E);
@@ expression E, E1; @@
-LOG(E, E1);
+NSLOG(netsurf, INFO, E, E1);
@@ expression E, E1, E2; @@
-LOG(E, E1, E2);
+NSLOG(netsurf, INFO, E, E1, E2);
@@ expression E, E1, E2, E3; @@
-LOG(E, E1, E2, E3);
+NSLOG(netsurf, INFO, E, E1, E2, E3);
@@ expression E, E1, E2, E3, E4; @@
-LOG(E, E1, E2, E3, E4);
+NSLOG(netsurf, INFO, E, E1, E2, E3, E4);
@@ expression E, E1, E2, E3, E4, E5; @@
-LOG(E, E1, E2, E3, E4, E5);
+NSLOG(netsurf, INFO, E, E1, E2, E3, E4, E5);
@@ expression E, E1, E2, E3, E4, E5, E6; @@
-LOG(E, E1, E2, E3, E4, E5, E6);
+NSLOG(netsurf, INFO, E, E1, E2, E3, E4, E5, E6);
@@ expression E, E1, E2, E3, E4, E5, E6, E7; @@
-LOG(E, E1, E2, E3, E4, E5, E6, E7);
+NSLOG(netsurf, INFO, E, E1, E2, E3, E4, E5, E6, E7);
Diffstat (limited to 'desktop/hotlist.c')
-rw-r--r-- | desktop/hotlist.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/desktop/hotlist.c b/desktop/hotlist.c index 0f5be77c9..13a52d0da 100644 --- a/desktop/hotlist.c +++ b/desktop/hotlist.c @@ -138,7 +138,8 @@ static nserror hotlist_save(const char *path) /* Replace any old hotlist file with the one we just saved */ if (rename(temp_path, path) != 0) { res = NSERROR_SAVE_FAILED; - LOG("Error renaming hotlist: %s.", strerror(errno)); + NSLOG(netsurf, INFO, "Error renaming hotlist: %s.", + strerror(errno)); goto cleanup; } @@ -652,20 +653,20 @@ static nserror hotlist_load_entry(dom_node *li, hotlist_load_ctx *ctx) /* The li must contain an "a" element */ a = libdom_find_first_element(li, corestring_lwc_a); if (a == NULL) { - LOG("Missing <a> in <li>"); + NSLOG(netsurf, INFO, "Missing <a> in <li>"); return NSERROR_INVALID; } derror = dom_node_get_text_content(a, &title1); if (derror != DOM_NO_ERR) { - LOG("No title"); + NSLOG(netsurf, INFO, "No title"); dom_node_unref(a); return NSERROR_INVALID; } derror = dom_element_get_attribute(a, corestring_dom_href, &url1); if (derror != DOM_NO_ERR || url1 == NULL) { - LOG("No URL"); + NSLOG(netsurf, INFO, "No URL"); dom_string_unref(title1); dom_node_unref(a); return NSERROR_INVALID; @@ -683,7 +684,8 @@ static nserror hotlist_load_entry(dom_node *li, hotlist_load_ctx *ctx) dom_string_unref(url1); if (err != NSERROR_OK) { - LOG("Failed normalising '%s'", dom_string_data(url1)); + NSLOG(netsurf, INFO, "Failed normalising '%s'", + dom_string_data(url1)); if (title1 != NULL) { dom_string_unref(title1); @@ -763,7 +765,8 @@ nserror hotlist_load_directory_cb(dom_node *node, void *ctx) error = dom_node_get_text_content(node, &title); if (error != DOM_NO_ERR || title == NULL) { - LOG("Empty <h4> or memory exhausted."); + NSLOG(netsurf, INFO, + "Empty <h4> or memory exhausted."); dom_string_unref(name); return NSERROR_DOM; } @@ -861,7 +864,7 @@ static nserror hotlist_load(const char *path, bool *loaded) /* Handle no path */ if (path == NULL) { - LOG("No hotlist file path provided."); + NSLOG(netsurf, INFO, "No hotlist file path provided."); return NSERROR_OK; } @@ -1283,7 +1286,7 @@ nserror hotlist_init( return err; } - LOG("Loading hotlist"); + NSLOG(netsurf, INFO, "Loading hotlist"); hl_ctx.tree = NULL; hl_ctx.built = false; @@ -1329,7 +1332,7 @@ nserror hotlist_init( * the treeview is built. */ hl_ctx.built = true; - LOG("Loaded hotlist"); + NSLOG(netsurf, INFO, "Loaded hotlist"); return NSERROR_OK; } @@ -1375,7 +1378,7 @@ nserror hotlist_fini(void) int i; nserror err; - LOG("Finalising hotlist"); + NSLOG(netsurf, INFO, "Finalising hotlist"); /* Remove any existing scheduled save callback */ guit->misc->schedule(-1, hotlist_schedule_save_cb, NULL); @@ -1384,7 +1387,7 @@ nserror hotlist_fini(void) /* Save the hotlist */ err = hotlist_save(hl_ctx.save_path); if (err != NSERROR_OK) { - LOG("Problem saving the hotlist."); + NSLOG(netsurf, INFO, "Problem saving the hotlist."); } free(hl_ctx.save_path); @@ -1403,7 +1406,7 @@ nserror hotlist_fini(void) return err; } - LOG("Finalised hotlist"); + NSLOG(netsurf, INFO, "Finalised hotlist"); return err; } |