start a simple log file examination

This commit is contained in:
George Danchev 2011-07-04 16:05:24 +00:00
parent 1076ad2970
commit 9c90c20734

View File

@ -63,18 +63,30 @@ fi
printf "\n${SELF}: Stopped at ${DEND}.\n" printf "\n${SELF}: Stopped at ${DEND}.\n"
if [ "${1}" == "-cleanup" ]; then if [ "${1}" == "-cleanup" ]; then
rm -f "${CLOG}" rm -f "${CLOG}"
else else
E2=`date '+%s'` E2=`date '+%s'`
let ES="${E2} - ${E1}" let ES="${E2} - ${E1}"
printf "\n${SELF}: Total time elapsed ${ES} sec." printf "\n${SELF}: Total time elapsed ${ES} sec."
printf "\n${SELF}: stdout&stderr saved in ${CLOG}.\n"
# TODO: work out a less noisy diff'ing technique! ##### TODO: work out a less noisy diff'ing technique!
# if [ -f "${CLOG}".prev -a -f "${CLOG}" ]; then #if [ -f "${CLOG}".prev -a -f "${CLOG}" ]; then
# printf "\n${SELF}: Log diff follows:\n" # printf "\n${SELF}: Log diff follows:\n"
# diff -Naur "${CLOG}".prev "${CLOG}" # diff -Naur "${CLOG}".prev "${CLOG}"
# fi #fi
#####
printf "\n${SELF}: Std(out|err) logged in ${CLOG}."
printf "\n${SELF}: Log file examination follows:\n"
# severity classes of libdax_msgs.h in libburn and libisofs
# List of boring keywords:
# 'UPDATE' A pacifier message during long running operations.
# List of interesting keywords:
LIST_KWD="(NEVER|ABORT|FATAL|FAILURE|MISHAP|SORRY|WARNING|HINT|NOTE|DEBUG|ALL)"
if [ -f "${CLOG}" ]; then
grep -n -PT "${LIST_KWD}" "${CLOG}"
fi
fi fi