host: Rewrite logbuf.

Log reading is essentially composed out of two parts: reading the old log lines
out of a log file, and (if streaming), keeping track of new log events and
forwarding them to the client.

As such, we create a listener based system, where Log will now follow a stream,
and transmit any new events. Internally then we use the same listener to write
logs to a file (buffered to one JSON object per line, or to a certain maximum
length), and provide a utility function that reads the events back from the
file, and sends them back into a specified channel.

So the procedure for returning logs, and following the tail: we read and stream
old lines, then we subscribe a listener and keep looping to receive new lines.

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>
host: Logbuf now can return a select number of log events.

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>
host: Implement log buffer line limiting for libvirt-lxc backend.

refs #133

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>
host: Implement log buffer line limiting for the docker backend.

refs #133

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>
host: Logbuf: Remove the event system.

The new implementation for tailing will not use the event system because of
possible races, but will keep tailing the logfile itself.

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>
host: Logbuf uses ActiveState/tail for tailing the file.

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>
all: Update Godeps.

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>
host: Lumberjack filename should be generated if empty.

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>
test, host: Fix usage of Logbuf/Lumberjack.

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>
host: Logbuf should create the file when the logger is created.

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>
host: Logbuf Read() now has a mechanism for stopping the read.

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>