better handling of hiding user questions from log files

This commit is contained in:
Nathaniel Landau
2015-03-10 22:43:32 -04:00
parent 0572706e47
commit 0c16692a41

View File

@@ -49,7 +49,9 @@ function _alert() { #my function
fi fi
if [ "${1}" = "input" ]; then if [ "${1}" = "input" ]; then
local color="${bold}" local color="${bold}"
printLog="0" # Don't print to $logFile # Don't print user questions to $logFile
savedvar="${printLog}"
printLog="0"
fi fi
if [ "${1}" = "info" ] || [ "${1}" = "notice" ]; then if [ "${1}" = "info" ] || [ "${1}" = "notice" ]; then
local color="" # Us terminal default color local color="" # Us terminal default color
@@ -75,7 +77,7 @@ function warning () { local _message="${@}"; echo "$(_alert warning)"; }
function notice () { local _message="${@}"; echo "$(_alert notice)"; } function notice () { local _message="${@}"; echo "$(_alert notice)"; }
function info () { local _message="${@}"; echo "$(_alert info)"; } function info () { local _message="${@}"; echo "$(_alert info)"; }
function debug () { local _message="${@}"; echo "$(_alert debug)"; } function debug () { local _message="${@}"; echo "$(_alert debug)"; }
function success () { local _message="${@}"; echo "$(_alert success)"; } function success () { local _message="${@}"; echo "$(_alert success)"; printLog="${savedvar}"; }
function input() { local _message="${@}"; echo "$(_alert input)"; } function input() { local _message="${@}"; echo "$(_alert input)"; }
function header() { local _message="========== ${@} ========== "; echo "$(_alert header)"; } function header() { local _message="========== ${@} ========== "; echo "$(_alert header)"; }