wip
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/hpcloud/tail"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
// https://godoc.org/github.com/hpcloud/tail#Config
|
||||
t, err := tail.TailFile(
|
||||
"/var/log/nginx.log",
|
||||
tail.Config{
|
||||
Follow: true,
|
||||
})
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
for line := range t.Lines {
|
||||
fmt.Println(line.Text)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user