This commit is contained in:
loveshell 2021-10-13 21:28:19 +08:00
parent a1dbeea552
commit ff96e4fb6a
10 changed files with 27 additions and 13 deletions

View File

@ -8,7 +8,7 @@ import (
"fmt" "fmt"
"os" "os"
"github.com/hpcloud/tail" "git.lovezsh.com/go-kit/tail"
) )
func args2config() (tail.Config, int64) { func args2config() (tail.Config, int64) {

8
go.mod Normal file
View File

@ -0,0 +1,8 @@
module git.lovezsh.com/go-kit/tail
go 1.16
require (
github.com/fsnotify/fsnotify v1.5.1
gopkg.in/tomb.v1 v1.0.0-20140529071818-c131134a1947
)

6
go.sum Normal file
View File

@ -0,0 +1,6 @@
github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI=
github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c h1:F1jZWGFhYfh0Ci55sIpILtKKK8p3i2/krTr0H1rg74I=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
gopkg.in/tomb.v1 v1.0.0-20140529071818-c131134a1947 h1:aNEcl02ps/eZaBJi2LycKl0jPsUryySSSgrCxieZRYA=
gopkg.in/tomb.v1 v1.0.0-20140529071818-c131134a1947/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=

View File

@ -15,9 +15,9 @@ import (
"sync" "sync"
"time" "time"
"github.com/hpcloud/tail/ratelimiter" "git.lovezsh.com/go-kit/tail/ratelimiter"
"github.com/hpcloud/tail/util" "git.lovezsh.com/go-kit/tail/util"
"github.com/hpcloud/tail/watch" "git.lovezsh.com/go-kit/tail/watch"
"gopkg.in/tomb.v1" "gopkg.in/tomb.v1"
) )

View File

@ -14,8 +14,8 @@ import (
"testing" "testing"
"time" "time"
"github.com/hpcloud/tail/ratelimiter" "git.lovezsh.com/go-kit/tail/ratelimiter"
"github.com/hpcloud/tail/watch" "git.lovezsh.com/go-kit/tail/watch"
) )
func init() { func init() {

View File

@ -3,7 +3,7 @@
package tail package tail
import ( import (
"github.com/hpcloud/tail/winfile" "git.lovezsh.com/go-kit/tail/winfile"
"os" "os"
) )

View File

@ -18,7 +18,7 @@ var LOGGER = &Logger{log.New(os.Stderr, "", log.LstdFlags)}
// fatal is like panic except it displays only the current goroutine's stack. // fatal is like panic except it displays only the current goroutine's stack.
func Fatal(format string, v ...interface{}) { func Fatal(format string, v ...interface{}) {
// https://github.com/hpcloud/log/blob/master/log.go#L45 // https://git.lovezsh.com/go-kit/log/blob/master/log.go#L45
LOGGER.Output(2, fmt.Sprintf("FATAL -- "+format, v...)+"\n"+string(debug.Stack())) LOGGER.Output(2, fmt.Sprintf("FATAL -- "+format, v...)+"\n"+string(debug.Stack()))
os.Exit(1) os.Exit(1)
} }

View File

@ -8,9 +8,9 @@ import (
"os" "os"
"path/filepath" "path/filepath"
"github.com/hpcloud/tail/util" "git.lovezsh.com/go-kit/tail/util"
"gopkg.in/fsnotify/fsnotify.v1" "github.com/fsnotify/fsnotify"
"gopkg.in/tomb.v1" "gopkg.in/tomb.v1"
) )

View File

@ -10,9 +10,9 @@ import (
"sync" "sync"
"syscall" "syscall"
"github.com/hpcloud/tail/util" "git.lovezsh.com/go-kit/tail/util"
"gopkg.in/fsnotify/fsnotify.v1" "github.com/fsnotify/fsnotify"
) )
type InotifyTracker struct { type InotifyTracker struct {

View File

@ -8,7 +8,7 @@ import (
"runtime" "runtime"
"time" "time"
"github.com/hpcloud/tail/util" "git.lovezsh.com/go-kit/tail/util"
"gopkg.in/tomb.v1" "gopkg.in/tomb.v1"
) )