]> git.cworth.org Git - sup/commitdiff
make SUP_LOG_LEVEL self-documenting
authorCarl Worth <cworth@cworth.org>
Wed, 26 Aug 2009 21:35:25 +0000 (14:35 -0700)
committerWilliam Morgan <wmorgan-sup@masanjin.net>
Tue, 1 Sep 2009 03:03:22 +0000 (23:03 -0400)
The idea here is that if someone is looking at the log and not seeing
the information of interest, then the log itself should tell them
how to get more information, (by suggesting to set SUP_LOG_LEVEL
to the next lower level).

bin/sup

diff --git a/bin/sup b/bin/sup
index 155bb65b49193d73cbf2123baae2a5ec54f6ebc1..1ca98194b2a48d29bd7f0d84463db9d97ca960a0 100755 (executable)
--- a/bin/sup
+++ b/bin/sup
@@ -187,6 +187,9 @@ begin
   lmode.on_kill { Logger.clear! }
   Logger.add_sink lmode
   Logger.force_message "Welcome to Sup! Log level is set to #{Logger.level}."
+  if Logger::LEVELS.index(Logger.level) > 0
+    Logger.force_message "For more verbose logging, restart with SUP_LOG_LEVEL=#{Logger::LEVELS[Logger::LEVELS.index(Logger.level)-1]}."
+  end
 
   debug "initializing inbox buffer"
   imode = InboxMode.new