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

« back to all changes in this revision

Viewing changes to state/apiserver/logger/export_test.go

  • Committer: Frank Mueller
  • Date: 2013-12-20 11:36:11 UTC
  • Revision ID: frank.mueller@canonical.com-20131220113611-0abqsnf63yx8bt0s
apiserver/logger: added logtailer and fixed tailer

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright 2012, 2013 Canonical Ltd.
 
2
// Licensed under the AGPLv3, see LICENCE file for details.
 
3
 
 
4
package logger
 
5
 
 
6
var (
 
7
        StartLogTailer     = startLogTailer
 
8
        StartChannelWriter = startChannelWriter
 
9
)
 
10
 
 
11
type Restorer interface {
 
12
        Restore()
 
13
}
 
14
 
 
15
type logLocationRestorer string
 
16
 
 
17
func (llr logLocationRestorer) Restore() {
 
18
        logLocation = string(llr)
 
19
}
 
20
 
 
21
func SetLogLocation(location string) Restorer {
 
22
        llr := logLocationRestorer(logLocation)
 
23
        logLocation = location
 
24
        return llr
 
25
}