summaryrefslogtreecommitdiffstats
path: root/src/hooks/arch
blob: e8f20f154a82253657e16a7245a8b0f6c778ff9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
. /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
}