Skip to content

papertrail/go-tail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-tail

A go package for tailing files. go get -u github.com/papertrail/go-tail

Usage

File reading follower

package main

import (
	"io"
	"fmt"
	"os"

	"github.com/papertrail/go-tail/follower"
)

func main() {
	t, err := follower.New("yourlogfile.log", follower.Config{
		Whence: io.SeekEnd,
		Offset: 0,
		Reopen: true,
	})

	for line := range t.Lines() {
		fmt.Println(line)
	}

	if t.Err() != nil {
		fmt.FPrintln(os.Stderr, t.Err())
	}
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages