From c8fcabec02dad14499f772d67d5aa3f3721ad513 Mon Sep 17 00:00:00 2001 From: icenine451 Date: Fri, 18 Oct 2024 09:27:41 -0400 Subject: [PATCH] Check logging level first for log() function for efficiency --- functions/logger.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/functions/logger.sh b/functions/logger.sh index 0b59cd65..f5d26324 100755 --- a/functions/logger.sh +++ b/functions/logger.sh @@ -17,6 +17,7 @@ # log i "par" rekku.log -> logs an information with message in the specified log file inside the logs folder retrodeck/logs/rekku.log log() { + if [[ ! $logging_level == "none" ]]; then local level="$1" local message="$2" @@ -85,7 +86,7 @@ log() { ;; esac - if [[ ! $logging_level == "none" ]]; then + # Display the message in the terminal echo -e "$colored_message" >&2