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

D. Hugh Redelmeier hugh at mimosa.com
Wed Oct 18 19:15:39 UTC 2017


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

2. Debug lines are not stand-alone, they have a context.  All state
   switches appear as debug lines

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.

For the grep problem, just grep for the thing of interest AND for
focus shifts.

Debug lines are long, noisy, and expensive already.  Adding a prefix might
well make this noticeably worse.

Practice might override this theory.


More information about the Swan-dev mailing list