Line | |
---|
1 | #########################################################################
|
---|
2 | #
|
---|
3 | # Printing/logging Subroutines
|
---|
4 | #
|
---|
5 | #########################################################################
|
---|
6 |
|
---|
7 | # Fatal error
|
---|
8 | #
|
---|
9 | printFATAL() {
|
---|
10 | printERROR ${1+"$@"}
|
---|
11 | main_exit_status=1
|
---|
12 | echo '1' > "$tmpERR"
|
---|
13 | (exit 1); exit 1;
|
---|
14 | }
|
---|
15 |
|
---|
16 | # Print a message to stderr
|
---|
17 | #
|
---|
18 | printERROR() {
|
---|
19 | echo "ERROR:" ${1+"$@"} >&2
|
---|
20 | }
|
---|
21 |
|
---|
22 | # Print a message to stderr
|
---|
23 | #
|
---|
24 | printWARNING() {
|
---|
25 | echo "WARNING:" ${1+"$@"} >&2
|
---|
26 | }
|
---|
27 |
|
---|
28 | # Print a message to stdout
|
---|
29 | #
|
---|
30 | printLOG() {
|
---|
31 | if test $silent -lt 2
|
---|
32 | then
|
---|
33 | now=`date`
|
---|
34 | if test -z "$logfile"
|
---|
35 | then
|
---|
36 | if test x"$simulate" = x0
|
---|
37 | then
|
---|
38 | echo "${now}:" ${1+"$@"}
|
---|
39 | else
|
---|
40 | echo "${now}: (simulate)" ${1+"$@"}
|
---|
41 | fi
|
---|
42 | else
|
---|
43 | if test x"$simulate" = x0
|
---|
44 | then
|
---|
45 | echo "${now}:" ${1+"$@"} >"$logfile"
|
---|
46 | else
|
---|
47 | echo "${now}: (simulate)" ${1+"$@"} >"$logfile"
|
---|
48 | fi
|
---|
49 | fi
|
---|
50 | fi
|
---|
51 | }
|
---|
52 |
|
---|
53 | # Print a message to stdout
|
---|
54 | #
|
---|
55 | printINFO() {
|
---|
56 | if test x"$silent" = x0
|
---|
57 | then
|
---|
58 | if test x"$simulate" = x0
|
---|
59 | then
|
---|
60 | echo ${1+"$@"}
|
---|
61 | else
|
---|
62 | echo "(simulate)" ${1+"$@"}
|
---|
63 | fi
|
---|
64 | fi
|
---|
65 | }
|
---|
66 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.