4 # Logging abilities for the shell initialisation scripts
6 # Copyright © 1994–2008 martin f. krafft <madduck@madduck.net>
7 # Released under the terms of the Artistic Licence 2.0
9 # Source repository: git://git.madduck.net/etc/zsh.git
13 local level; level="$1"; shift
14 echo "${level}: $@" >&2
20 [[ -o xtrace ]] && set +x && local __XTRACE=1
22 [ "${__XTRACE:-}" ] && set -x
25 [[ -o xtrace ]] && set +x && local __XTRACE=1
27 [ "${__XTRACE:-}" ] && set -x
30 [[ -o xtrace ]] && set +x && local __XTRACE=1
32 [ "${__XTRACE:-}" ] && set -x
35 [[ -o xtrace ]] && set +x && local __XTRACE=1
36 __do_debug && __log D "$@"
37 [ "${__XTRACE:-}" ] && set -x