dfilter: Improve debug format

This commit is contained in:
João Valverde 2023-01-02 02:47:15 +00:00
parent f5bfe89785
commit c762d8492b
2 changed files with 9 additions and 8 deletions

View File

@ -1556,7 +1556,7 @@ dfw_semcheck(dfwork_t *dfw)
{
volatile gboolean ok_filter = TRUE;
ws_noisy("Starting semantic check (dfw = %p)", dfw);
ws_debug("Starting semantic check (dfw = %p)", dfw);
/* Instead of having to check for errors at every stage of
* the semantic-checking, the semantic-checking code will
@ -1569,7 +1569,7 @@ dfw_semcheck(dfwork_t *dfw)
}
ENDTRY;
ws_noisy("Semantic check (dfw = %p) returns %s",
ws_debug("Semantic check (dfw = %p) returns %s",
dfw, ok_filter ? "TRUE" : "FALSE");
return ok_filter;

View File

@ -333,12 +333,13 @@ sprint_node(stnode_t *node)
{
wmem_strbuf_t *buf = wmem_strbuf_new(NULL, NULL);
wmem_strbuf_append_printf(buf, "stnode{ ");
wmem_strbuf_append_printf(buf, "magic=0x%"PRIx32", ", node->magic);
wmem_strbuf_append_printf(buf, "type=%s, ", stnode_type_name(node));
wmem_strbuf_append_printf(buf, "data=<%s>, ", stnode_todebug(node));
wmem_strbuf_append_printf(buf, "location=%ld:%zu",
wmem_strbuf_append_printf(buf, "{ ");
wmem_strbuf_append_printf(buf, "magic = 0x%"PRIx32", ", node->magic);
wmem_strbuf_append_printf(buf, "type = %s, ", stnode_type_name(node));
wmem_strbuf_append_printf(buf, "data = %s, ", stnode_todebug(node));
wmem_strbuf_append_printf(buf, "location = %ld:%zu",
node->location.col_start, node->location.col_len);
wmem_strbuf_append_printf(buf, " }");
return wmem_strbuf_finalize(buf);
}
@ -390,7 +391,7 @@ log_test_full(enum ws_log_level level,
rhs = sprint_node(st_rhs);
ws_log_write_always_full(WS_LOG_DOMAIN, level, file, line, func,
"%s: LHS = %s; RHS = %s",
"%s:\n LHS = %s\n RHS = %s",
stnode_todebug(node),
lhs ? lhs : "NULL",
rhs ? rhs : "NULL");