Add debug trunc flags for parsing and message

This commit is contained in:
Olof hagsand 2025-02-17 09:05:37 +01:00
parent 7394958453
commit 9df084958e
12 changed files with 61 additions and 26 deletions

View file

@ -132,7 +132,10 @@ api_path_parse(char *api_path,
int retval = -1;
clixon_api_path_yacc ay = {0,};
clixon_debug(CLIXON_DBG_PARSE, "%s", api_path);
if (clixon_debug_get() & CLIXON_DBG_DETAIL)
clixon_debug(CLIXON_DBG_PARSE|CLIXON_DBG_DETAIL, "%s", api_path);
else
clixon_debug(CLIXON_DBG_PARSE|CLIXON_DBG_TRUNC, "%s", api_path);
ay.ay_parse_string = api_path;
ay.ay_name = "api-path parser";
ay.ay_linenum = 1;
@ -151,7 +154,7 @@ api_path_parse(char *api_path,
*cplist = ay.ay_top;
retval = 0;
done:
clixon_debug(CLIXON_DBG_PARSE, "retval: %d", retval);
clixon_debug(CLIXON_DBG_PARSE|CLIXON_DBG_DETAIL, "retval: %d", retval);
return retval;
}
@ -178,7 +181,10 @@ instance_id_parse(char *path,
int retval = -1;
clixon_instance_id_yacc iy = {0,};
clixon_debug(CLIXON_DBG_PARSE, "%s", path);
if (clixon_debug_get() & CLIXON_DBG_DETAIL)
clixon_debug(CLIXON_DBG_PARSE|CLIXON_DBG_DETAIL, "%s", path);
else
clixon_debug(CLIXON_DBG_PARSE|CLIXON_DBG_TRUNC, "%s", path);
iy.iy_parse_string = path;
iy.iy_name = "instance-id parser";
iy.iy_linenum = 1;
@ -197,7 +203,7 @@ instance_id_parse(char *path,
*cplist = iy.iy_top;
retval = 0;
done:
clixon_debug(CLIXON_DBG_PARSE, "retval: %d", retval);
clixon_debug(CLIXON_DBG_PARSE|CLIXON_DBG_DETAIL, "retval: %d", retval);
return retval;
}