~dave-cheney/juju-core/always-vet-struct-tags

« back to all changes in this revision

Viewing changes to container/lxc/clonetemplate.go

  • Committer: Tarmac
  • Author(s): Tim Penhey
  • Date: 2014-04-04 04:52:38 UTC
  • mfrom: (2562.1.3 tailer-tweaks)
  • Revision ID: tarmac-20140404045238-d7u8vf41arfm1n3i
[r=thumper] Extend the tailer utility.

When looking at the pyjuju debug-log, there was a replay
function that allowed getting the log from the start.
There was no way to tell the tailer to start from the
beginning of the file.

I changed the meaning of NewTailer to be one that doesn't
do any seeking. The NewTailerBacktrack does seek to the end,
and then goes back a certain number of lines.

There was a bug in the backtrack tailer when zero lines
were passed in. This is fixed and a test added.

The number of lines to look back is now a uint, as negative
values make no sense at all.

https://codereview.appspot.com/84290045/

Show diffs side-by-side

added added

removed removed

Lines of Context:
179
179
        }
180
180
 
181
181
        tailWriter := &logTail{tick: time.Now()}
182
 
        consoleTailer := tailer.NewTailer(console, tailWriter, 0, nil)
 
182
        consoleTailer := tailer.NewTailer(console, tailWriter, nil)
183
183
        defer consoleTailer.Stop()
184
184
 
185
185
        // We should wait maybe 1 minute between output?