From dfbc83e12cb8d86bf4bcb9017d9a43234293c67b Mon Sep 17 00:00:00 2001 From: William Melody Date: Sun, 7 Jun 2020 12:34:55 -0700 Subject: [PATCH] Improve `_debug()`. --- hosts | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/hosts b/hosts index 97ba22a..acb0cda 100755 --- a/hosts +++ b/hosts @@ -90,23 +90,14 @@ _debug() { if [[ "${_USE_DEBUG:-"0"}" -eq 1 ]] then __DEBUG_COUNTER=$((__DEBUG_COUNTER+1)) - # Prefix debug message with "bug (U+1F41B)" - printf "🐛 %s " "${__DEBUG_COUNTER}" - "${@}" - printf "――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――\\n" + { + # Prefix debug message with "bug (U+1F41B)" + printf "🐛 %s " "${__DEBUG_COUNTER}" + "${@}" + printf "―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――\\n" + } 1>&2 fi } -# debug() -# -# Usage: -# debug "Debug info. Variable: $0" -# -# Print the specified message if the `$_USE_DEBUG` variable has been set. -# -# This is a shortcut for the _debug() function that simply echos the message. -debug() { - _debug echo "${@}" -} ############################################################################### # Error Messaging