<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 18 October 2017 at 15:15, D. Hugh Redelmeier <span dir="ltr"><<a href="mailto:hugh@mimosa.com" target="_blank">hugh@mimosa.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">| From: Andrew Cagney <<a href="mailto:andrew.cagney@gmail.com">andrew.cagney@gmail.com</a>><br>
<span class=""><br>
| I'm wondering if debug output should be prefixed with the connection/state<br>
| information as in:<br>
|<br>
| | "westnet-eastnet" #1: .....<br>
|<br>
| for our our tests it doesn't matter, but in the field when there are lots<br>
| of connections, being able to grep for this string makes things easier<br>
<br>
</span>The original theory was:<br>
<br>
1. Debug lines are for the developers.  If the users need them, that<br>
   itself is a bug.<br>
<br></blockquote><div><br></div><div>Good theory ....<br></div><div><br></div><div>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).<br></div><div><br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
2. Debug lines are not stand-alone, they have a context.  All state<br>
   switches appear as debug lines<br>
<br></blockquote><div><br></div><div>Except when threads and sub-processes interleave their [debug] log lines!</div><div><br></div><div>grep '#NNN' is a lot easier to explain and understand<br></div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
3. (non-debug) log lines can be interleaved since an arbitrary number<br>
   of negotiations can be going on simultaneously<br>
<br>
4. debug lines are not interleaved: switching of attention happens<br>
   rarely and is noted.<br>
<br></blockquote><div><br></div><div>See above, this assumption isn't true.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
For the grep problem, just grep for the thing of interest AND for<br>
focus shifts.<br>
<br></blockquote><div><br></div><div>I think that is too complex (short of also including a script to do it, and needing the script is too complex).</div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Debug lines are long, noisy, and expensive already.  Adding a prefix might<br>
well make this noticeably worse.<br><br></blockquote><div><br></div><div>Andrew<br></div></div></div></div>