Revision 9116
Added by Aaron Marcuse-Kubitza over 11 years ago
util.sh | ||
---|---|---|
250 | 250 |
# `|| return` needed on Mac because of bug where -e doesn't apply to () |
251 | 251 |
function limit_stderr() |
252 | 252 |
{ |
253 |
inc_log_level # should only apply during this function for use by can_log |
|
253 | 254 |
if test "$stdout2stderr"; then |
254 | 255 |
if ! can_log; then exec 1>/dev/null; else stdout2stderr; fi |
255 | 256 |
else |
256 | 257 |
if ! can_log; then exec 2>/dev/null; fi |
257 | 258 |
fi |
258 | 259 |
} |
259 |
alias limit_stderr='inc_log_level; limit_stderr' |
|
260 | 260 |
|
261 |
fi # load new aliases |
|
262 |
if self_being_included; then |
|
263 |
|
|
264 | 261 |
limit_stderr_cmd() # usage: [stdout2stderr=1] limit_stderr_cmd cmd... |
265 | 262 |
{ |
266 | 263 |
case "$1" in echo_run) shift; echo_run_prep;; esac |
Also available in: Unified diff
bugfix: lib/sh/util.sh: limit_stderr(): switched back to running inc_log_level inside limit_stderr(), because it should only apply during the function for use by can_log. documented why inc_log_level needs to be inside limit_stderr().