Re: [PATCHv2] cld: use XDR for all messages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 9, 2010 at 5:33 PM, Jeff Garzik <jeff@xxxxxxxxxx> wrote:
> On 02/09/2010 07:21 PM, Pete Zaitcev wrote:
>>
>> On Tue, 09 Feb 2010 18:21:02 -0500
>> Jeff Garzik<jeff@xxxxxxxxxx>  wrote:
>>
>>> So, the programs themselves have it right -- debug/verbose is an integer
>>> not a bool.  The internal libraries get that wrong sometimes, though.
>>>
>>> Having separate knobs for 'debug' and 'verbose' will be more confusing
>>> than a single control, IMO.
>>
>> I dunno, I think bigger packages tend to drift towards bitmasks.
>> But I don't have a strong opinion. I just wanted to restore the
>> per-packet output that you wanted. If you think that an integer is
>> better, that's fine. The newer code should is more regular and easier
>> to mold in any desired way.
>
> Integer or bitmask, either one is fine with me.  Anything but two separate
> variables, one for 'debug' and one for 'verbose'.  Programmers tend to like
> bitmasks, and users tend to -not- like them if forced to perform binary
> math.

I like bitmasks personally. If something is breaking, and you think
it's in the foo subsystem, you can tell users to turn on debugging for
just the foo system.

Even better is the ability to set the logging level after the program
has been started. Sometimes you just run into these scenarios where
the process has been running for a week, and it suddenly flakes out.

I wrote a logging system once where the daemon listened on a unix
domain socket. By sending messages to that socket, you could change
the log level on the fly.

Of course, there's a lot of other ways of getting the same
information, like using gdb to read variables, or wireshark. When I
was working on the XDR patch, I just hacked in a bunch of calls to
print the packet header in various places.

Colin
--
To unsubscribe from this list: send the line "unsubscribe hail-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Fedora Clound]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux