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

Antony Antony antony at phenome.org
Mon Oct 30 16:57:25 UTC 2017


On Mon, Oct 30, 2017 at 12:43:51PM -0400, Andrew Cagney wrote:
> On 30 October 2017 at 12:00, Antony Antony <antony at phenome.org> wrote:
> 
> > On Mon, Oct 30, 2017 at 10:18:58AM -0400, Andrew Cagney wrote:
> > > On 18 October 2017 at 14:11, Antony Antony <antony at phenome.org> wrote:
> > >
> > > > On Wed, Oct 18, 2017 at 11:35:55AM -0400, Andrew Cagney wrote:
> > > > > Hi,
> > > > >
> > > > > I'm wondering if debug output should be prefixed with the
> > > > connection/state
> > > > > information as in:
> > > > >
> > > > > | "westnet-eastnet" #1: .....
> > > >
> > > > If every line add such a prefix it would be hard to read, I would
> > struggle
> > > > to read the debug logs prepended with 10-30 character prefix, think of
> > OE,
> > > > the prefix will be long. I have tried it in th past and did not like
> > it,
> > > > except
> > > > for grepping:)
> > > >
> > > > It could be setup option, like logtime.
> > > >
> > > >
> > > Yea.  I'm going to add:
> > >
> > >   --debug add-prefix
> >
> > I would love to see a testrun with this enabled before merging it to
> > master.
> > I am wondering how oe tests debug like will look like.  Also if you eanble
> > time.
> >
> >
> The below is from after explicitly enabling the option with:
> 
>     ipsec whack --debug add-prefix
> 
> Oct 30 12:38:55.367727: | "private-or-clear#192.1.2.0/24"[1] ...192.1.2.23
> #1 UNDEFINED: category states: 1 count states: 1
> Oct 30 12:38:55.367875: | "private-or-clear#192.1.2.0/24"[1] ...192.1.2.23
> #1 PARENT_I1: Queuing pending IPsec SA negotiating with 192.1.2.23
> "private-or-clear#192.1.2.0/24"[1] ...192.1.2.23 IKE SA #1
> "private-or-clear#192.1.2.0/24"[1] ...192.1.2.23
> O

this looks odd to me. The prefix should be be before "|" I would like to see 
the full log. Interleaved with log lines, Debug dump lines before this goes 
to master. 

I am still not convinced it is grep friendly. The way I imagne is relatively 
easy to grep and easy to remove the prefix with sed. Hence the suggestion 
"|" before. 

-antony


More information about the Swan-dev mailing list