From 80463e92135e82e0754349d1c00409cf985a0576 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 25 Nov 2024 18:20:08 +0100 Subject: [PATCH] logs --- sh/log.sh | 7 +++++-- sh/main.sh | 7 ++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/sh/log.sh b/sh/log.sh index 1674324..4e7a63e 100644 --- a/sh/log.sh +++ b/sh/log.sh @@ -58,7 +58,10 @@ _sh_log() { shift local line for line in "${@}"; do - [ -n "${prefix}" ] && printf "%s" "${prefix} " - echo "${line}" + if [ -n "${prefix}" ]; then + _sh_main_log "${prefix} ${line}" + else + _sh_main_log "${line}" + fi done } diff --git a/sh/main.sh b/sh/main.sh index 4fbecc3..1cc1116 100644 --- a/sh/main.sh +++ b/sh/main.sh @@ -70,9 +70,10 @@ _sh_main_commands() { _sh_main_log() { case "${-}" in *i*) - local argument - for argument in "${@}"; do - echo "${argument}" + [ -n "${1}" ] || set -- "" + local line + for line in "${@}"; do + echo "${line}" done ;; *) ;;