[buildd-tools-devel] Status of logging in sbuild

Roger Leigh rleigh at codelibre.net
Wed Jan 25 12:55:35 UTC 2012


On Wed, Jan 25, 2012 at 11:49:50AM +0100, Max Thoursie wrote:
> I've been working on some local changes to make sbuild integrate with
> our CI build tool (teamcity). While doing that I found logging to be
> in a kind of messy state. There are several methods to print a log
> messages and I'd love to help clean it up, so I'm asking writing to
> ask which methods should be deprecated.
> 
> The current situation seems to be that most logging happens through
> the log method in Base.pm, but there is also several print statements.
> In addition there's a Log.pm which seems to be unused.
> 
> Since what I would like to do is to override the logging behavior, I'm
> in favor of using a separate class for logging like in Log.pm, but
> deeming from the history it seems like the development has gone in the
> other direction.

The logging in sbuild has a bit of a messy and ugly history.

sbuild used to maintain two logs, a "main log" and a per-package
"build log".  The main log was recently removed when batch mode was
removed, making it redundant.  Sbuild::Log is a remnant of this,
and may be safely removed.

The logging in sbuild opens a log stream to a logger process, used
for log filtering.  It also reopens stdout/err to redirect to the
logger.  In consequence it's possible to log via the log functions
(which can potentially do other formatting/rewriting), or directly
via stdout/err, since this is also captured.

Ideally, sbuild would just send *everything* to stdout/err and not
contain any logging at all, leaving this up to buildd, which could
redirect the streams when invoking it, but it looks like we're
stuck with it for the time being.

In theory, everything should be done via the log() function, the
intention being that sbuild could be adapted to run multiple
builds in parallel.  But given that we removed batch mode and
the log code also affects global state (stdout/err), it could
(and probably should) be updated to be a set of global functions.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/buildd-tools-devel/attachments/20120125/ffaa5925/attachment.pgp>


More information about the Buildd-tools-devel mailing list