blob: eee0777e654b7729d710b2cdc76dacf402d0b0ef [file] [log] [blame] [raw]
# Default info blocks put to the left of the screen
log_daemon_msg_pre () {
if log_use_fancy_output; then
printf "[....] " || true
fi
}
log_begin_msg_pre () {
log_daemon_msg_pre "$@"
}
log_end_msg_pre () {
if log_use_fancy_output; then
RED=$( $TPUT setaf 1)
GREEN=$( $TPUT setaf 2)
YELLOW=$( $TPUT setaf 3)
if [ "$TERM" = cygwin ]; then
RED="`$TPUT bold`$RED"
GREEN="`$TPUT bold`$GREEN"
YELLOW="`$TPUT bold`$YELLOW"
NORMAL="`$TPUT sgr0`"
else
NORMAL=$( $TPUT op)
fi
$TPUT civis || true
$TPUT sc && \
{ $TPUT hpa 0 || printf \\r; } && \
if [ $1 -eq 0 ]; then
printf %s "[${GREEN} OK ${NORMAL}" || true
elif [ $1 -eq 255 ]; then
printf %s "[${YELLOW}WARN${NORMAL}" || true
else
printf %s "[${RED}FAIL${NORMAL}" || true
fi && \
$TPUT rc || true
$TPUT cnorm || true
fi
}
log_action_msg_pre () {
if log_use_fancy_output; then
CYAN=$( $TPUT setaf 6)
NORMAL=$( $TPUT op)
printf %s "[${CYAN}INFO${NORMAL}] " || true
fi
}
log_action_begin_msg_pre () {
log_daemon_msg_pre "$@"
}
log_action_end_msg_pre () {
log_end_msg_pre "$@"
}