summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2008-09-02 09:00:12 -0400
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>2008-09-02 09:00:12 -0400
commit7d9b281e67d75163d491e303d4693a00667b7f91 (patch)
treeff3af0b43e598648b347ee43faa3f4887876f624
parenta07556b5ce12eaa2c3ceb51f5b6cce7884775c0f (diff)
cleanup stray commas, ensure that ill-specified loglevels default to INFO
-rw-r--r--src/common19
-rw-r--r--website/download.mdwn2
2 files changed, 17 insertions, 4 deletions
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 ##