From 16674a07a55b5338e290c4c0e6f02e7c0c77265f Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 7 Jun 2021 12:52:21 +0200 Subject: [PATCH] logger: improve formatting Make enough room for the timestamp to include the last ] Add a space before the actual log line. --- spa/plugins/support/logger.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spa/plugins/support/logger.c b/spa/plugins/support/logger.c index fa042c11d..d0a59a5a0 100644 --- a/spa/plugins/support/logger.c +++ b/spa/plugins/support/logger.c @@ -78,7 +78,7 @@ impl_log_logv(void *object, #define RESERVED_LENGTH 24 struct impl *impl = object; - char timestamp[14] = {0}; + char timestamp[15] = {0}; char filename[64] = {0}; char location[1000 + RESERVED_LENGTH], *p, *s; static const char *levels[] = { "-", "E", "W", "I", "D", "T", "*T*" }; @@ -115,7 +115,7 @@ impl_log_logv(void *object, s ? s + 1 : file, line, func); } - size = spa_scnprintf(p, len, "%s[%s]%s%s", prefix, levels[level], + size = spa_scnprintf(p, len, "%s[%s]%s%s ", prefix, levels[level], timestamp, filename); /* * it is assumed that at this point `size` <= `len`,