cleaned up

This commit is contained in:
2025-09-08 12:10:10 +02:00
parent a2fd70e096
commit d5b3d7c597
21 changed files with 522 additions and 498 deletions

15
src/sh/log.sh Normal file
View File

@@ -0,0 +1,15 @@
# Logging methods
ERR="\033[38;5;196m"
INFO="\033[38;5;75m"
OFF="\033[m"
LOGDIR="$HOME/.local/state/$APP_NAME"
[ -d "$LOGDIR" ] || mkdir -p "$LOGDIR"
LOGFILE="$LOGDIR/log"
err() {
echo "$(date) [$$]>${ERR}ERROR:${OFF} ${1:-}" | tee -a "$LOGFILE" | cut -d ">" -f 2- >/dev/stderr
}
info() {
echo "$(date) [$$]>${INFO}Info:${OFF} ${1:-}" | tee -a "$LOGFILE" | cut -d ">" -f 2- >/dev/stderr
}