commented sh files

This commit is contained in:
2025-09-11 15:57:06 +02:00
parent 3702bc54a8
commit 0fe55ba06d
17 changed files with 483 additions and 190 deletions

View File

@@ -1,4 +1,7 @@
# Logging methods
#
# The default log file is `LOGFILE`. In the future, this file may become
# configurable.
if [ ! "${LOG_LOADED:-}" ]; then
ERR="\033[38;5;196m"
INFO="\033[38;5;75m"
@@ -11,10 +14,14 @@ if [ ! "${LOG_LOADED:-}" ]; then
export LOG_LOADED=1
fi
# Print an error message to stderr and log it incuding the time stamp and PID
# to the log file.
err() {
echo "$(date) [$$]>${ERR}ERROR:${OFF} ${1:-}" | tee -a "$LOGFILE" | cut -d ">" -f 2- >/dev/stderr
}
# Print information to stderr and log it incuding the time stamp and PID to the
# log file.
info() {
echo "$(date) [$$]>${INFO}Info:${OFF} ${1:-}" | tee -a "$LOGFILE" | cut -d ">" -f 2- >/dev/stderr
}