All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: Pete Zaitcev <zaitcev@redhat.com>
Cc: Project Hail List <hail-devel@vger.kernel.org>
Subject: Re: [Patch 1/3] CLD: End-to-end verbosity
Date: Tue, 06 Apr 2010 10:40:33 -0400	[thread overview]
Message-ID: <4BBB47E1.1080901@garzik.org> (raw)
In-Reply-To: <20100331184302.6ec6e69c@redhat.com>

On 03/31/2010 08:43 PM, Pete Zaitcev wrote:
> diff --git a/server/server.c b/server/server.c
> index 3208e0f..2d68ee6 100644
> --- a/server/server.c
> +++ b/server/server.c
> @@ -55,7 +55,7 @@ static struct argp_option options[] = {
>   	  "Store database environment in DIRECTORY.  Default: "
>   	  CLD_DEF_DATADIR },
>   	{ "debug", 'D', "LEVEL", 0,
> -	  "Set debug output to LEVEL (0 = off, 2 = max)" },
> +	  "Set debug output to LEVEL (0 = off, 1 = debugging)" },
>   	{ "stderr", 'E', NULL, 0,
>   	  "Switch the log to standard error" },
>   	{ "foreground", 'F', NULL, 0,
> @@ -64,6 +64,8 @@ static struct argp_option options[] = {
>   	  "Bind to UDP port PORT.  Default: " CLD_DEF_PORT },
>   	{ "pid", 'P', "FILE", 0,
>   	  "Write daemon process id to FILE.  Default: " CLD_DEF_PIDFN },
> +	{ "verbose", 'v', NULL, 0,
> +	  "Enable the session-level verbosity" },
>   	{ "strict-free", 1001, NULL, 0,
>   	  "For memory-checker runs.  When shutting down server, free local "
>   	  "heap, rather than simply exit(2)ing and letting OS clean up." },


As is hinted by the current code's debugging switch being an integer 
'level' value, the server [and client?] has increasing levels of 
verbosity.  The debug levels are

	0: key messages affecting server operation, only
	1: debugging output enabled, sans per-packet output
	2: debugging output enabled, including per-packet output

ie. clearly ordered by increasing value == increased verbosity.

As is clearly illustrated when I cut the patch down to the above 
snippet, the user interface you have created gives the user two "knobs" 
for log verbosity, and it is not clear to a casual user which knob 
controls which sets of messages.  That makes for a -more- confusing user 
interface, because the user must constantly ask themselves the question 
"do I need debug?  or verbose?  I don't know!"

Additionally, this interface changes runs counter to other tools, which 
increase verbosity with added "-v" switches -- analagous to the existing 
integer-based debug level interface.

If it is truly your desire to permit fine-grained selection of certain 
classes of messages, then don't dick around!  Go ahead and create a 
bitmap "log mask" which permits fine-grained selection of various 
messages, much like netif_msg_* and netif_msg_init() in the kernel's 
include/linux/netdevice.h.

Having two switches, -d and -v, for different, undocumented classes of 
message just increases confusion.  Put yourself in the mind of a user 
trying to figure out which is which.

I readily admit the __internal implementation__ resulting from your 
patches is a useful cleanup, but at a macro level, it merely increases 
logging user interface confusion.

	Jeff


  reply	other threads:[~2010-04-06 14:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-01  0:43 [Patch 1/3] CLD: End-to-end verbosity Pete Zaitcev
2010-04-06 14:40 ` Jeff Garzik [this message]
2010-04-07  3:32   ` Pete Zaitcev
2010-04-07  4:36     ` Jeff Garzik
2010-04-07  5:22       ` Pete Zaitcev

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=4BBB47E1.1080901@garzik.org \
    --to=jeff@garzik.org \
    --cc=hail-devel@vger.kernel.org \
    --cc=zaitcev@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.