We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0ac1242 + 0400d2c commit d79aba5Copy full SHA for d79aba5
tail.go
@@ -11,11 +11,18 @@ import (
11
12
func tailFile(ctx context.Context, file string, poll bool, dest *os.File) {
13
defer wg.Done()
14
+
15
+ s, err := os.Stat(file)
16
+ if err != nil {
17
+ log.Fatalf("unable to stat %s: %s", file, err)
18
+ }
19
20
t, err := tail.TailFile(file, tail.Config{
21
Follow: true,
22
ReOpen: true,
23
Poll: poll,
24
Logger: tail.DiscardingLogger,
25
+ Pipe: s.Mode()&os.ModeNamedPipe != 0,
26
})
27
if err != nil {
28
log.Fatalf("unable to tail %s: %s", file, err)
0 commit comments