diff mbox series

parser: log syntax error in sw-description

Message ID 20230526114253.399337-1-sbabic@denx.de
State Accepted
Headers show
Series parser: log syntax error in sw-description | expand

Commit Message

Stefano Babic May 26, 2023, 11:42 a.m. UTC
Error code and line are rather just printed to stderr instead of putting
in the log, and this makes debugging more difficult.

Signed-off-by: Stefano Babic <sbabic@denx.de>
---
 parser/parser.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/parser/parser.c b/parser/parser.c
index f2d4948b..4c0a8f2f 100644
--- a/parser/parser.c
+++ b/parser/parser.c
@@ -976,11 +976,7 @@  int parse_cfg (struct swupdate_cfg *swcfg, const char *filename)
 	/* Read the file. If there is an error, report it and exit. */
 	DEBUG("Parsing config file %s", filename);
 	if(config_read_file(&cfg, filename) != CONFIG_TRUE) {
-		printf("%s ", config_error_file(&cfg));
-		printf("%d ", config_error_line(&cfg));
-		printf("%s ", config_error_text(&cfg));
-
-		fprintf(stderr, "%s:%d - %s\n", config_error_file(&cfg),
+		ERROR("%s:%d - %s\n", config_error_file(&cfg),
 			config_error_line(&cfg), config_error_text(&cfg));
 		config_destroy(&cfg);
 		return -1;