diff --git a/scripts/functions b/scripts/functions index 79a14158..4199e921 100644 --- a/scripts/functions +++ b/scripts/functions @@ -102,14 +102,15 @@ CT_DoLog() { # Usage: CT_DoEnd CT_DoEnd() { + local level="$1" CT_STOP_DATE=`CT_DoDate +%s%N` CT_STOP_DATE_HUMAN=`CT_DoDate +%Y%m%d.%H%M%S` - CT_DoLog INFO "Build completed at ${CT_STOP_DATE_HUMAN}" + CT_DoLog "${level:-INFO}" "Build completed at ${CT_STOP_DATE_HUMAN}" elapsed=$((CT_STOP_DATE-CT_STAR_DATE)) elapsed_min=$((elapsed/(60*1000*1000*1000))) elapsed_sec=`printf "%02d" $(((elapsed%(60*1000*1000*1000))/(1000*1000*1000)))` elapsed_csec=`printf "%02d" $(((elapsed%(1000*1000*1000))/(10*1000*1000)))` - CT_DoLog ${1:-INFO} "(elapsed: ${elapsed_min}:${elapsed_sec}.${elapsed_csec})" + CT_DoLog ${level:-INFO} "(elapsed: ${elapsed_min}:${elapsed_sec}.${elapsed_csec})" } # Abort the execution with an error message