aboutsummaryrefslogtreecommitdiff
path: root/lib/logging.bash
diff options
context:
space:
mode:
Diffstat (limited to 'lib/logging.bash')
-rw-r--r--lib/logging.bash9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/logging.bash b/lib/logging.bash
index c120abf..37b947d 100644
--- a/lib/logging.bash
+++ b/lib/logging.bash
@@ -17,6 +17,15 @@ log() {
>&2
}
+## :bocs:
+## :section: 3
+## :heading: functions
+## :name: debug
+## :param: The system to log for.
+## :param: The message to log.
+##
+## Log a debug-level message. This message only shows if BASHTARD_DEBUG
+## evaluates to a truthy value.
debug() { [[ -n $BASHTARD_DEBUG ]] && log "$1" "$(printf "\e[0;37m%s" "${@:2}")" ; }
info() { log "$1" "$(printf "\e[m%s" "${@:2}")" ; }
notice() { log "$1" "$(printf "\e[0;34m%s" "${@:2}")" ; }