From: Daniel Kahn Gillmor Date: Tue, 2 Sep 2008 13:00:12 +0000 (-0400) Subject: cleanup stray commas, ensure that ill-specified loglevels default to INFO X-Git-Tag: monkeysphere_0.12-1~28 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7d9b281e67d75163d491e303d4693a00667b7f91;p=monkeysphere.git cleanup stray commas, ensure that ill-specified loglevels default to INFO --- diff --git a/src/common b/src/common index f93793e..4e731e1 100644 --- a/src/common +++ b/src/common @@ -33,6 +33,10 @@ log() { local priority local level local output + # don't include SILENT in alllevels: it's handled separately + # list in decreasing verbosity (all caps) + local alllevels="DEBUG INFO ERROR" + local found= # translate lowers to uppers in global log level LOG_LEVEL=$(echo "$LOG_LEVEL" | tr "[:lower:]" "[:upper:]") @@ -42,16 +46,25 @@ log() { return fi + for level in $alllevels; do + if [ "$LOG_LEVEL" = "$level" ] ; then + found=true + fi + done + if [ -z "$found" ] ; then + # default to INFO: + LOG_LEVEL=INFO + fi + # get priority from first parameter, translating all lower to # uppers priority=$(echo "$1" | tr "[:lower:]" "[:upper:]") shift # scan over available levels - # list in decreasing verbosity (all caps) - for level in DEBUG INFO ERROR ; do + for level in $alllevels ; do # output if the log level matches, set output to true - # this will output for all subsequenty loops as well. + # this will output for all subsequent loops as well. if [ "$LOG_LEVEL" = "$level" ] ; then output=true fi diff --git a/website/download.mdwn b/website/download.mdwn index 69048c9..b64711d 100644 --- a/website/download.mdwn +++ b/website/download.mdwn @@ -20,7 +20,7 @@ configuration](http://cmrg.fifthhorseman.net/wiki/apt/importing-keys "Instructions for adding dkg's key to apt") Once you've installed the packages, you might want to read up on how -to get started [as a regular user](/getting-started-user), or [as a +to get started [as a regular user](/getting-started-user) or [as a systems administrator](/getting-started-admin). ## Enhancements ##