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.
If this were normal code I'd agree, but it conceals the structure of the
test here.

Tests generally follow the pattern of setup followed by execution followed
by verification, and in the example here you conflate assignment (ls and
cid) with execution (cl).  I'm going to play with this a bit more, but lets
talk about it too tomorrow.

-jeff


On Tue, Jul 29, 2014 at 4:27 PM, Peter Bourgon <notifications@github.com>
wrote:

> In harpoon-agent/logs_test.go:
>
> > @@ -0,0 +1,242 @@
> > +package main
> > +
> > +import (
> > +	"reflect"
> > +	"testing"
> > +	"time"
> > +)
> > +
> > +// TestContainerLog
> > +func TestGetContainerLogForEmptyLogSet(t *testing.T) {
> > +	ls := NewLogSet(3)
> > +	cid := ContainerID(1)
> > +	cl := ls.getContainerLog(cid)
>
> When you have more than 1 declaration in a row like this, wrap them in a
> var block.
>
> var (
>     ls  = NewLogSet(3)
>     cid = ContainerID(1)
>     cl  = ls.getContainerLog(cid))
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/soundcloud/harpoon/pull/13/files#r15525598>.
>