Merge pull request #63 from ekini/master

Make Logger an interface, so external logger can be used, closes #52
This commit is contained in:
Nino Khodabandeh 2015-10-27 22:38:56 -07:00
commit 213cadfb2e
1 changed files with 13 additions and 1 deletions

14
tail.go
View File

@ -39,6 +39,18 @@ type SeekInfo struct {
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.
type Config struct {
// File-specifc
@ -54,7 +66,7 @@ type Config struct {
// Logger, when nil, is set to tail.DefaultLogger
// To disable logging: set field to tail.DiscardingLogger
Logger *log.Logger
Logger logger
}
type Tail struct {