~rogpeppe/juju-core/themue-058-debug-log-api

« back to all changes in this revision

Viewing changes to state/apiserver/debugger/logtailer.go

  • Committer: Frank Mueller
  • Date: 2014-01-23 14:14:49 UTC
  • mfrom: (2152.1.95 juju-core)
  • Revision ID: frank.mueller@canonical.com-20140123141449-b30l57y7gs3wjkpw
debugger: merged trunk and fixed permission and interface problems

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
        return lt.writer.Lines()
49
49
}
50
50
 
51
 
// Stop terminates the log tailer by closing in- and output
52
 
// after stopping the tailer.
53
 
func (lt *logTailer) Stop() error {
 
51
// Kill tells the log tailer to stop working.
 
52
func (lt *logTailer) Kill() {
54
53
        defer func() {
55
54
                err := lt.writer.Close()
56
55
                if err != nil {
63
62
                        logger.Errorf("cannot close log file: %v", err)
64
63
                }
65
64
        }()
66
 
        return lt.tailer.Stop()
 
65
        lt.tailer.Kill(nil)
 
66
}
 
67
 
 
68
// Wait waits until the log tailer is stopped due to command
 
69
// or an error. In case of an error it returns the reason.
 
70
func (lt *logTailer) Wait() error {
 
71
        return lt.tailer.Wait()
 
72
}
 
73
 
 
74
// Stop terminates the log tailer by closing in- and output
 
75
// after stopping the tailer.
 
76
func (lt *logTailer) Stop() error {
 
77
        lt.Kill()
 
78
        return lt.Wait()
67
79
}
68
80
 
69
81
// Err implements the Errer interface.