Revision 9378
Added by Aaron Marcuse-Kubitza over 11 years ago
util.sh | ||
---|---|---|
222 | 222 |
# for unfiltered messages, the log_level is 0 (i.e. still output at verbosity=0) |
223 | 223 |
# to view a message's log_level, count the # of + signs before it in the output |
224 | 224 |
|
225 |
alias PS4_prefix_n='str="${PS4:0:1}" n=$1 repeat' |
|
226 |
|
|
227 | 225 |
fi # load new aliases |
228 | 226 |
if self_being_included; then |
229 | 227 |
|
... | ... | |
235 | 233 |
log+() |
236 | 234 |
{ |
237 | 235 |
# no local vars because w/o cmd, assignments should be applied to caller |
238 |
PS4="$(if test "$1" -gt 0; then echo "$(PS4_prefix_n)$PS4"
|
|
236 |
PS4="$(if test "$1" -gt 0; then echo "$(str="${PS4:0:1}" n="$1" repeat)$PS4"
|
|
239 | 237 |
else echo "${PS4: -$1}"; fi)" \ |
240 | 238 |
verbosity="$(float+int "$verbosity" "-$1")" "${@:2}" |
241 | 239 |
} |
Also available in: Unified diff
lib/sh/util.sh: log+: inlined PS4_prefix_n alias because there is now room for it