-
-
Save dale3h/3a147106c32a6a3c927306d5d1040b49 to your computer and use it in GitHub Desktop.
[Hass.io] Colored Log Viewer for Home Assistant
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
################################################################ | |
## @usage clog folder_watcher=magenta,system_log=red | |
## @colors https://www.npmjs.com/package/colors#text-colors | |
## @license MIT | |
## @author Dale Higgs <@dale3h> | |
################################################################ | |
[[ -n "$(command -v apk)" ]] \ | |
|| { echo "[ERROR] could not find apk"; exit 1; } | |
[[ -n "$(command -v npm)" ]] \ | |
|| { echo "[INFO] installing npm..."; apk add nodejs; } \ | |
|| { echo "[ERROR] could not install npm"; exit 1; } | |
[[ -n "$(command -v color-logviewer)" ]] \ | |
|| { echo "[INFO] installing color-logviewer..."; npm install -g color-logviewer; } \ | |
|| { echo "[ERROR] could not install color-logviewer"; exit 1; } | |
colors= | |
[[ -n "$CLOG_COLORS" ]] && colors="$colors$CLOG_COLORS," | |
[[ -n "$1" ]] && colors="$colors$1," | |
clear | |
color-logviewer -c ${colors}ERROR=red,WARN=yellow,INFO=green,DEBUG=cyan,TRACE=blue /config/home-assistant.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment