Skip to content

Commit cbcd5d3

Browse files
committed
Yaml: use trace macros insead of verbose()
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
1 parent fb6a19e commit cbcd5d3

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

parsers/yaml.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "parse.h"
2020
#include "read.h"
2121
#include "subparser.h"
22+
#include "trace.h"
2223
#include "types.h"
2324
#include "yaml.h"
2425

@@ -148,8 +149,16 @@ static void findYamlTags (void)
148149
leaveSubparser ();
149150
}
150151

151-
verbose("yaml token:%s<%d>@Line:%"PRIuPTR"\n", tokenTypeName[token.type], token.type,
152+
TRACE_PRINT("yaml token:%s<%d>@Line:%"PRIuPTR"", tokenTypeName[token.type], token.type,
152153
token.start_mark.line + 1);
154+
if (isTraced() && token.type == YAML_SCALAR_TOKEN)
155+
{
156+
TRACE_PRINT_FMT(" ");
157+
for (size_t i = 0; i < token.data.scalar.length; i++)
158+
TRACE_PRINT_FMT("%c", token.data.scalar.value[i]);
159+
TRACE_PRINT_NEWLINE();
160+
}
161+
153162
if (token.type == YAML_STREAM_END_TOKEN)
154163
done = true;
155164

0 commit comments

Comments
 (0)