commented sh files
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user