Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don’t block on write if we’ve been killed #163

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# API v1 (gopkg.in/hpcloud/tail.v1)
# API v1 (gopkg.in/paulsc/tail.v1)

## April, 2016

* Migrated to godep, as depman is not longer supported
* Introduced golang vendoring feature
* Fixed issue [#57](https://github.com/hpcloud/tail/issues/57) related to reopen deleted file
* Fixed issue [#57](https://github.com/paulsc/tail/issues/57) related to reopen deleted file

## July, 2015

* Fix inotify watcher leak; remove `Cleanup` (#51)

# API v0 (gopkg.in/hpcloud/tail.v0)
# API v0 (gopkg.in/paulsc/tail.v0)

## June, 2015

Expand Down
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
FROM golang

RUN mkdir -p $GOPATH/src/github.com/hpcloud/tail/
ADD . $GOPATH/src/github.com/hpcloud/tail/
RUN mkdir -p $GOPATH/src/github.com/paulsc/tail/
ADD . $GOPATH/src/github.com/paulsc/tail/

# expecting to fetch dependencies successfully.
RUN go get -v github.com/hpcloud/tail
RUN go get -v github.com/paulsc/tail

# expecting to run the test successfully.
RUN go test -v github.com/hpcloud/tail
RUN go test -v github.com/paulsc/tail

# expecting to install successfully
RUN go install -v github.com/hpcloud/tail
RUN go install -v github.com/hpcloud/tail/cmd/gotail
RUN go install -v github.com/paulsc/tail
RUN go install -v github.com/paulsc/tail/cmd/gotail

RUN $GOPATH/bin/gotail -h || true

Expand Down
2 changes: 1 addition & 1 deletion Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ fmt:

# Run the test in an isolated environment.
fulltest:
docker build -t hpcloud/tail .
docker build -t paulsc/tail .
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[![Build Status](https://travis-ci.org/hpcloud/tail.svg)](https://travis-ci.org/hpcloud/tail)
[![Build status](https://ci.appveyor.com/api/projects/status/vrl3paf9md0a7bgk/branch/master?svg=true)](https://ci.appveyor.com/project/Nino-K/tail/branch/master)
# Paul's fork

Also check https://github.com/hpcloud/tail
Also check https://github.com/nxadm/tail

# Go package for tail-ing files

Expand All @@ -12,7 +14,7 @@ for line := range t.Lines {
}
```

See [API documentation](http://godoc.org/github.com/hpcloud/tail).
See [API documentation](http://godoc.org/github.com/paulsc/tail).

## Log rotation

Expand All @@ -21,8 +23,8 @@ designed to work with log rotation tools.

## Installing

go get github.com/hpcloud/tail/...
go get github.com/paulsc/tail/...

## Windows support

This package [needs assistance](https://github.com/hpcloud/tail/labels/Windows) for full Windows support.
This package [needs assistance](https://github.com/paulsc/tail/labels/Windows) for full Windows support.
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build_script:
- SET GOPATH=c:\workspace
- go test -v -race ./...
test: off
clone_folder: c:\workspace\src\github.com\hpcloud\tail
clone_folder: c:\workspace\src\github.com\paulsc\tail
branches:
only:
- master
2 changes: 1 addition & 1 deletion cmd/gotail/gotail.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"fmt"
"os"

"github.com/hpcloud/tail"
"github.com/paulsc/tail"
)

func args2config() (tail.Config, int64) {
Expand Down
12 changes: 8 additions & 4 deletions tail.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import (
"sync"
"time"

"github.com/hpcloud/tail/ratelimiter"
"github.com/hpcloud/tail/util"
"github.com/hpcloud/tail/watch"
"github.com/paulsc/tail/ratelimiter"
"github.com/paulsc/tail/util"
"github.com/paulsc/tail/watch"
"gopkg.in/tomb.v1"
)

Expand Down Expand Up @@ -414,7 +414,11 @@ func (tail *Tail) sendLine(line string) bool {
}

for _, line := range lines {
tail.Lines <- &Line{line, now, nil}
select {
case tail.Lines <- &Line{line, now, nil}:
case <-tail.Dying():
return true
}
}

if tail.Config.RateLimiter != nil {
Expand Down
4 changes: 2 additions & 2 deletions tail_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"testing"
"time"

"github.com/hpcloud/tail/ratelimiter"
"github.com/hpcloud/tail/watch"
"github.com/paulsc/tail/ratelimiter"
"github.com/paulsc/tail/watch"
)

func init() {
Expand Down
2 changes: 1 addition & 1 deletion tail_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package tail

import (
"github.com/hpcloud/tail/winfile"
"github.com/paulsc/tail/winfile"
"os"
)

Expand Down
2 changes: 1 addition & 1 deletion util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
func Fatal(format string, v ...interface{}) {
// https://github.com/hpcloud/log/blob/master/log.go#L45
// https://github.com/paulsc/log/blob/master/log.go#L45
LOGGER.Output(2, fmt.Sprintf("FATAL -- "+format, v...)+"\n"+string(debug.Stack()))
os.Exit(1)
}
Expand Down
2 changes: 1 addition & 1 deletion watch/inotify.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"os"
"path/filepath"

"github.com/hpcloud/tail/util"
"github.com/paulsc/tail/util"

"gopkg.in/fsnotify/fsnotify.v1"
"gopkg.in/tomb.v1"
Expand Down
2 changes: 1 addition & 1 deletion watch/inotify_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"sync"
"syscall"

"github.com/hpcloud/tail/util"
"github.com/paulsc/tail/util"

"gopkg.in/fsnotify/fsnotify.v1"
)
Expand Down
2 changes: 1 addition & 1 deletion watch/polling.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"runtime"
"time"

"github.com/hpcloud/tail/util"
"github.com/paulsc/tail/util"
"gopkg.in/tomb.v1"
)

Expand Down