summaryrefslogtreecommitdiff
path: root/internal/io
diff options
context:
space:
mode:
authorPaul Buetow <pbuetow@mimecast.com>2020-03-04 16:32:27 +0000
committerPaul Buetow <pbuetow@mimecast.com>2020-03-04 16:32:27 +0000
commit238dd3930e9c58397a86f649c77912ee32e4d7f0 (patch)
treeb4cda0b8c677188b600478522471628b5d4efea4 /internal/io
parent89d3ebfc4e0c947977e5f455ee76f3ce29cc92c7 (diff)
can tail probe with a given timeout and then write a mapreduce result
Diffstat (limited to 'internal/io')
-rw-r--r--internal/io/fs/readfile.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/internal/io/fs/readfile.go b/internal/io/fs/readfile.go
index 321432e..cb16ec1 100644
--- a/internal/io/fs/readfile.go
+++ b/internal/io/fs/readfile.go
@@ -5,6 +5,7 @@ import (
"compress/gzip"
"context"
"errors"
+ "fmt"
"io"
"os"
"regexp"
@@ -39,6 +40,16 @@ type readFile struct {
limiter chan struct{}
}
+// String returns the string representation of the readFile
+func (f readFile) String() string {
+ return fmt.Sprintf("readFile(filePath:%s,globID:%s,retry:%v,canSkipLines:%v,seekEOF:%v)",
+ f.filePath,
+ f.globID,
+ f.retry,
+ f.canSkipLines,
+ f.seekEOF)
+}
+
// FilePath returns the full file path.
func (f readFile) FilePath() string {
return f.filePath
@@ -51,6 +62,7 @@ func (f readFile) Retry() bool {
// Start tailing a log file.
func (f readFile) Start(ctx context.Context, lines chan<- line.Line, regex string) error {
+ logger.Debug("readFile", f)
defer func() {
select {
case <-f.limiter: