From 926d7d27edbaff9bb2ca96d3a59c781e7c23f9e0 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sun, 21 May 2023 15:44:42 +0200 Subject: [PATCH] add time for each line of a log message --- script | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/script b/script index f8d7838..ba1179c 100755 --- a/script +++ b/script @@ -77,7 +77,9 @@ log() { esac if [ $LEVEL -ge $LOG_VERBOSE_VALUE ]; then - printf "%s%s%s\n" "${COLOR:-}" "${TIME:-}" "$*" >&2 + printf "%s" "$*" | while IFS='' read -r LINE; do + printf "%s%s%s\n" "${COLOR:-}" "${TIME:-}" "$LINE" >&2 + done fi }