github.com/decred/dcrlnd@v0.7.6/lntest/itest/log_check_errors.sh (about) 1 #!/bin/bash 2 3 # Note(decred) this is currently disabled due to not being up to date with dcrlnd. 4 exit 0 5 6 BASEDIR=$(dirname "$0") 7 8 echo "" 9 10 # Filter all log files for errors, substitute variable data and match against whitelist. 11 find $BASEDIR -name "*.log" | xargs grep -h "\[ERR\]" | \ 12 sed -r -f $BASEDIR/log_substitutions.txt | \ 13 sort | uniq | \ 14 grep -Fvi -f $BASEDIR/log_error_whitelist.txt 15 16 # If something shows up (not on whitelist) exit with error code 1. 17 if [[ $? -eq 0 ]]; then 18 echo "" 19 echo "In the itest logs, the log line (patterns) above were detected." 20 echo "[ERR] lines are generally reserved for internal errors." 21 echo "Resolve the issue by either changing the log level or adding an " 22 echo "exception to log_error_whitelist.txt" 23 echo "" 24 25 exit 1 26 fi 27 28 echo "No itest errors detected." 29 echo ""