add time for each line of a log message
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Simon Vieille 2023-05-21 15:44:42 +02:00
parent 02603c84b4
commit 926d7d27ed
Signed by: deblan
GPG key ID: 579388D585F70417

4
script
View file

@ -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
}