Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: cworth@cworth.org (Carl Worth)
Subject: [sup-talk] [PATCH] Make SUP_LOG_LEVEL self-documenting.
Date: Wed, 26 Aug 2009 14:35:25 -0700	[thread overview]
Message-ID: <1251322427-sup-9184@yoom.home.cworth.org> (raw)
In-Reply-To: <1250972634-sup-6871@masanjin.net>

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).
---

Excerpts from William Morgan's message of Sat Aug 22 13:25:22 -0700 2009:
> It all looks good except you can use Logger::LEVELS to access the
> constants. Then there's no need to write a LEVELS method. If you fix
> that I will apply. Thanks!

Thanks. I had the distinct feeling I was doing something wrong
there. Here's a corrected version.

-Carl

 bin/sup |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/bin/sup b/bin/sup
index 3d5b6c1..cdf1ff2 100755
--- a/bin/sup
+++ b/bin/sup
@@ -169,6 +169,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
-- 
1.6.3.3

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://rubyforge.org/pipermail/sup-talk/attachments/20090826/3686da0d/attachment.bin>


  reply	other threads:[~2009-08-26 21:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-20  5:25 Carl Worth
2009-08-22 20:25 ` William Morgan
2009-08-26 21:35   ` Carl Worth [this message]
2009-09-01  3:06     ` William Morgan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1251322427-sup-9184@yoom.home.cworth.org \
    --to=cworth@cworth.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox