forked from hpcloud/tail
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
start working on tail's readme/example
- Loading branch information
Sridhar Ratnakumar
committed
Oct 12, 2012
1 parent
74f8401
commit f7193d4
Showing
4 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Tail implementation in Go | ||
|
||
A Go package striving to emulate the BSD `tail` program. | ||
|
||
```Go | ||
t := tail.TailFile("/var/log/nginx.log", 1000, true, true) | ||
for line := range t.Lines { | ||
fmt.Println(line.Text) | ||
} | ||
``` | ||
|
||
## TODO | ||
|
||
* tests | ||
* command line program (`tail -f ...`) | ||
* refactor: use Config? `NewTail(tail.Config{Filename: "", Follow: tail.FOLLOW_NAME})` | ||
* refactor: get rid of 'end' flag; allow `-n <number>` with `-n -1` | ||
for end. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
tail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
default: tail | ||
|
||
tail: *.go | ||
GOPATH=~/as/logyard go build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"logyard/tail" | ||
) | ||
|
||
var samplefile = "/Users/sridharr/Library/Logs/PyPM/1.3/PyPM.log" | ||
|
||
func main() { | ||
t, err := tail.TailFile(samplefile, 1000, true, true) | ||
if err != nil { | ||
panic(err) | ||
} | ||
for line := range t.Lines { | ||
fmt.Println(line.Text) | ||
} | ||
} |