V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 41s

Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
2025-07-25 17:33:58 +02:00
parent 0db950e2b7
commit 02bff792e1
9 changed files with 130 additions and 121 deletions

View File

@@ -77,16 +77,18 @@ do_get_log_color() {
# Arguments:
# 1: "${LOG_LEVEL}" one of: "debug" | "info" | "notice" | "warn" | "error" | "critical" | "fatal" | "emergency"
# 2: "${LOG_ONLY}" one of: "file_only" | "tty"
# @: "${MESSAGE[*]}" arbitrary text string to log.
# *: "${*}" arbitrary text string to log.
#######################################
do_log() {
### Reading arguments.
declare var_log_level="$1"; shift
declare var_log_only="$2"; shift
declare ary_message=("$@")
declare var_msg_string="${ary_message[*]}"
declare var_log_only="$1"; shift
declare var_msg_string="${*}"
### Declare variables.
declare var_color; var_color=$(do_get_log_color "${var_log_level}")
declare var_ts; var_ts="$(date -u '+%Y-%m-%dT%H:%M:%S.%4N%z')"
declare var_log_entry=("${var_ts} [${var_log_level}]: ${ary_message[*]}")
declare var_log_entry=("${var_ts} [${var_log_level}]: ${var_msg_string}")
if do_should_log "${var_log_level}"; then
if [[ "${var_log_only,,}" == "file_only" ]]; then