Logging api

Reviewers:  @bernerdschaefer, @peterbourgon 

First pass at the internals of the logging API.  This is two layers thick.  There is a RingBuffer for log messages, and on top of this is a data structure that implements storage for and operations for each container.  (The RingBuffer probably should have been a separate submit.)

The next piece to be worked on will be the HTTP logging interface.
Nice simplification!  Thank you.


On Fri, Aug 1, 2014 at 9:31 AM, Peter Bourgon <notifications@github.com>
wrote:

> In harpoon-agent/logs.go:
>
> > +}
> > +
> > +// AddLogLine feeds a log entry into a log buffer and notifies all listeners.
> > +//
> > +// METRICS:
> > +//  # number lines received
> > +//  # number log lines flushed
> > +//  # of notifications delivered
> > +//  # number notifications dropped
> > +//
> > +// NOTES:
> > +//  If the number of dropped notifications goes up then a listener is not consuming
> > +//  notifications fast enough.  Look for a stalled listener.
> > +func (cl *containerLog) AddLogLine(logLine string) {
> > +	cl.addc <- logAdd{logLine: logLine}
> > +}
>
> ...and then this function becomes the much nicer version: cl.addc <-
> logLine
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/soundcloud/harpoon/pull/13/files#r15684830>.
>