Check logging level first for log() function for efficiency

This commit is contained in:
icenine451 2024-10-18 09:27:41 -04:00
parent 2e1a461855
commit c8fcabec02

View file

@ -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 i "par" rekku.log -> logs an information with message in the specified log file inside the logs folder retrodeck/logs/rekku.log
log() { log() {
if [[ ! $logging_level == "none" ]]; then
local level="$1" local level="$1"
local message="$2" local message="$2"
@ -85,7 +86,7 @@ log() {
;; ;;
esac esac
if [[ ! $logging_level == "none" ]]; then
# Display the message in the terminal # Display the message in the terminal
echo -e "$colored_message" >&2 echo -e "$colored_message" >&2