diff mbox series

Make output for images more grep friendly

Message ID 20201110161544.128911-1-sbabic@denx.de
State Accepted
Headers show
Series Make output for images more grep friendly | expand

Commit Message

Stefano Babic Nov. 10, 2020, 4:15 p.m. UTC
SWUpdate output goes often into systemd log or another logging system
and it should be easier to be searcched. The fixed output has differ
from the rest of SWUpdate's log and it becomens more difficult to
search.

Signed-off-by: Stefano Babic <sbabic@denx.de>
---
 core/cpio_utils.c       |  7 ++++---
 core/stream_interface.c | 10 ++++++----
 2 files changed, 10 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/core/cpio_utils.c b/core/cpio_utils.c
index 0399bea..0508862 100644
--- a/core/cpio_utils.c
+++ b/core/cpio_utils.c
@@ -721,9 +721,10 @@  int extract_sw_description(int fd, const char *descfile, off_t *offs)
 
 	close(fdout);
 
-	TRACE("Found file:\n\tfilename %s\n\tsize %lu\n\tchecksum 0x%lx %s",
-		fdh.filename,
-		(unsigned long)fdh.size,
+	TRACE("Found file");
+	TRACE("filename %s", fdh.filename);
+	TRACE("\tsize %lu", (unsigned long)fdh.size);
+	TRACE("\tchecksum 0x%lx %s",
 		(unsigned long)checksum,
 		(checksum == fdh.chksum) ? "VERIFIED" : "WRONG");
 
diff --git a/core/stream_interface.c b/core/stream_interface.c
index 8946faf..8285c72 100644
--- a/core/stream_interface.c
+++ b/core/stream_interface.c
@@ -94,7 +94,9 @@  static int extract_file_to_tmp(int fd, const char *fname, unsigned long *poffs)
 		ERROR("Path too long: %s%s", TMPDIR, fdh.filename);
 		return -1;
 	}
-	TRACE("Found file:\n\tfilename %s\n\tsize %u", fdh.filename, (unsigned int)fdh.size);
+	TRACE("Found file");
+	TRACE("\tfilename %s", fdh.filename);
+	TRACE("\tsize %u", (unsigned int)fdh.size);
 
 	fdout = openfileoutput(output_file);
 	if (fdout < 0)
@@ -196,9 +198,9 @@  static int extract_files(int fd, struct swupdate_cfg *software)
 					break;
 			}
 
-			TRACE("Found file:\n\tfilename %s\n\tsize %u %s",
-				fdh.filename,
-				(unsigned int)fdh.size,
+			TRACE("Found file");
+			TRACE("\tfilename %s", fdh.filename);
+			TRACE("\tsize %u %s", (unsigned int)fdh.size,
 				(skip == SKIP_FILE ? "Not required: skipping" : "required"));
 
 			fdout = -1;