From e60a644968984a65ea996fef4b81e3084cf0186b Mon Sep 17 00:00:00 2001 From: ge Date: Thu, 19 May 2022 08:53:14 +0300 Subject: [PATCH] feat: Update log() --- src/lib/common.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/lib/common.sh b/src/lib/common.sh index 9111fc2..de53660 100644 --- a/src/lib/common.sh +++ b/src/lib/common.sh @@ -26,9 +26,6 @@ log() { local message local print - local log_file - - log_file="$__log_file" # Read message from STDIN if args not passed. [[ ! -t 0 ]] || [[ "$#" == 0 ]] && message="$(cat <&0)" @@ -48,7 +45,7 @@ log() { while read -r line; do if [[ "$line" ]]; then - printf '[%s] [%s] %s\n' "$(date +"$log_date_fmt")" "$0" "$line" >> "$log_file" + printf '[%s] %s\n' "$(date +"$log_date_fmt")" "$line" >> "$__log_file" fi done <<< "$(sed -r 's/\x1B\[(([0-9]+)(;[0-9]+)*)?[m,K,H,f,J]//g' <<< "$message")" }