From f64eeaf4866c71c43c89cf96deff69d386fefa06 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Thu, 24 Jul 2025 14:24:19 +0200 Subject: [PATCH] logging_ctl.sh: change log aliases to functions Change `dlog*` aliases to functions. Signed-off-by: Marc Herbert Signed-off-by: Dmitrii Golovanov --- case-lib/logging_ctl.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/case-lib/logging_ctl.sh b/case-lib/logging_ctl.sh index 86905836..162e6dfe 100644 --- a/case-lib/logging_ctl.sh +++ b/case-lib/logging_ctl.sh @@ -44,8 +44,9 @@ _func_log_cmd() for key in "${!LOG_LIST[@]}"; do - # dymaic alias the command with different content - cmd="alias $key='echo \$(date -u \"+%F %T %Z\")$ext_message ${LOG_LIST[$key]}'" + # shellcheck disable=SC2016 + local date_cmd='$(date -u "+%F %T %Z")' + local cmd="$key() { printf '%s%s %s\n' \"$date_cmd\" '$ext_message ${LOG_LIST[$key]}' \"\$*\" ; }" eval "$cmd" done }