[Swan-dev] prefixing debug lines with connection/state?

Andrew Cagney andrew.cagney at gmail.com
Wed Oct 18 21:03:38 UTC 2017


On 18 October 2017 at 15:15, D. Hugh Redelmeier <hugh at mimosa.com> wrote:

> | From: Andrew Cagney <andrew.cagney at gmail.com>
>
> | I'm wondering if debug output should be prefixed with the
> connection/state
> | information as in:
> |
> | | "westnet-eastnet" #1: .....
> |
> | for our our tests it doesn't matter, but in the field when there are lots
> | of connections, being able to grep for this string makes things easier
>
> The original theory was:
>
> 1. Debug lines are for the developers.  If the users need them, that
>    itself is a bug.
>
>
Good theory ....

However, we also need to be able to enable find-grained tracing of specific
sub-systems on large servers.  To be specific, --debug xauth to see how we
interact with the xauth server (the reality is that our debug options are
so useless that this isn't possible, instead --debug all rules the day).


2. Debug lines are not stand-alone, they have a context.  All state
>    switches appear as debug lines
>
>
Except when threads and sub-processes interleave their [debug] log lines!

grep '#NNN' is a lot easier to explain and understand


3. (non-debug) log lines can be interleaved since an arbitrary number
>    of negotiations can be going on simultaneously
>
> 4. debug lines are not interleaved: switching of attention happens
>    rarely and is noted.
>
>
See above, this assumption isn't true.

For the grep problem, just grep for the thing of interest AND for
> focus shifts.
>
>
I think that is too complex (short of also including a script to do it, and
needing the script is too complex).

Debug lines are long, noisy, and expensive already.  Adding a prefix might
> well make this noticeably worse.
>
>
Andrew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.libreswan.org/pipermail/swan-dev/attachments/20171018/bd8b77c8/attachment-0001.html>


More information about the Swan-dev mailing list