Project

General

Profile

« Previous | Next » 

Revision 9120

lib/sh/util.sh: logging: visually separate the log_level-based indenting from the external command indenting by using the standard `set -x` prefix (1st char of PS4) for log_level indenting and $log_level_indent (i.e. whitespace) for external command indenting

View differences:

lib/sh/util.sh
177 177

  
178 178
# usage: in func:      indent; ...
179 179
#        outside func: indent; ...; outdent
180
alias indent='declare PS4="$log_level_indent$PS4"'
181
alias outdent='declare PS4="${PS4#$log_level_indent}"'
180
alias indent='declare PS4="${PS4:0:1}$PS4"'
181
alias outdent='declare PS4="${PS4#${PS4:0:1}}"'
182 182

  
183 183
# usage: in func:      inc_log_level; ...
184 184
#        outside func: inc_log_level; ...; dec_log_level

Also available in: Unified diff