Make Logger an interface, so external logger can be used, closes #52
This commit is contained in:
parent
05d326f717
commit
8dfe0aa72f
14
tail.go
14
tail.go
|
@ -39,6 +39,18 @@ type SeekInfo struct {
|
||||||
Whence int // os.SEEK_*
|
Whence int // os.SEEK_*
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type logger interface {
|
||||||
|
Fatal(v ...interface{})
|
||||||
|
Fatalf(format string, v ...interface{})
|
||||||
|
Fatalln(v ...interface{})
|
||||||
|
Panic(v ...interface{})
|
||||||
|
Panicf(format string, v ...interface{})
|
||||||
|
Panicln(v ...interface{})
|
||||||
|
Print(v ...interface{})
|
||||||
|
Printf(format string, v ...interface{})
|
||||||
|
Println(v ...interface{})
|
||||||
|
}
|
||||||
|
|
||||||
// Config is used to specify how a file must be tailed.
|
// Config is used to specify how a file must be tailed.
|
||||||
type Config struct {
|
type Config struct {
|
||||||
// File-specifc
|
// File-specifc
|
||||||
|
@ -54,7 +66,7 @@ type Config struct {
|
||||||
|
|
||||||
// Logger, when nil, is set to tail.DefaultLogger
|
// Logger, when nil, is set to tail.DefaultLogger
|
||||||
// To disable logging: set field to tail.DiscardingLogger
|
// To disable logging: set field to tail.DiscardingLogger
|
||||||
Logger *log.Logger
|
Logger logger
|
||||||
}
|
}
|
||||||
|
|
||||||
type Tail struct {
|
type Tail struct {
|
||||||
|
|
Loading…
Reference in New Issue