feat(legacy): +writeDash +helpers

This commit is contained in:
2025-11-03 18:51:38 +00:00
parent ad00891e6b
commit 532f4b0901
12 changed files with 117 additions and 65 deletions

View File

@@ -0,0 +1,21 @@
#!/bin/dash
log() {
level="${1:?}"; shift
case "$level" in
trace) color="$MAGENTA" ;;
debug) color="$BLUE" ;;
info) color="$GREEN" ;;
notice) color="$CYAN" ;;
warn) color="$YELLOW" ;;
error) color="$RED" ;;
*) color="$WHITE" ;;
esac
# shellcheck disable=SC1003
fmt="$(printf "%s" "${1:?}" | sed 's/\\033\[0m/''\'"$color"'/g')"
shift
printf "%b\n" "$color$fmt$NC" "$@" >&2
}