. /etc/rc.d/functions

### Logging/Error reporting for Arch Linux

function report_err {
    printhl "$*"
}

function report_warn {
    printhl "$*"
}

function report_try {
    stat_busy "$*"
    REPORT_TRYING=1
}

function report_fail {
    if [[ -n "$*" ]]; then
        if [[ -n "$REPORT_TRYING" ]]; then
            stat_append "- $*"
            REPORT_TRYING=
            stat_fail
        else
            printhl "$*"
        fi
    elif [[ -n "$REPORT_TRYING" ]]; then
        REPORT_TRYING=
        stat_fail
    fi
}

function report_success {
    if [[ -n "$*" ]]; then
        stat_append "- $*"
    fi
    stat_done
}
