[apparmor] [PATCH 20/31] parser: Remove prints and exits from features code

Steve Beattie steve at nxnw.org
Thu Jan 22 23:16:45 UTC 2015


On Thu, Jan 22, 2015 at 04:23:00PM -0600, Tyler Hicks wrote:
> On 2015-01-22 10:11:42, John Johansen wrote:
> > I'm all for removing regular prints from the code for the library but
> > do we really want to remove debug prints that only show up when the code
> > is compiled with debugging enabled?
> 
> Good question. libapparmor currently has no debug logging so I continued
> that tradition.

That's not entirely accurate. While it's not built into the configure
system, you can set YYDEBUG to a non-zero value in src/grammar.y
to get bison debugging output. I make use of this when I need to
diagnose why the logparsing stuff doesn't catch a message, usually
due to random changes to log formatting.

For diagnosing things going wrong, I'd like to see more debugging
instrumentation in libapparmor, not less.

> We don't know what a program linking to libapparmor will do with
> stdout/stderr so I don't know if debug logging to those streams is
> helpful.
> 
> Maybe in the near future we could add a debug build option to
> libapparmor and have it support an env variable that specifies a file
> path to open and log debug messages to?

That would be a very nice improvement indeed.

-- 
Steve Beattie
<sbeattie at ubuntu.com>
http://NxNW.org/~steve/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20150122/b9ba7d37/attachment.pgp>


More information about the AppArmor mailing list