Documentation ¶
Overview ¶
Package tailer provides a class that is responsible for tailing log files and extracting new log lines to be passed into the virtual machines.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LogLine ¶
type LogLine struct { Filename string // The log filename that this line was read from Line string // The text of the log line itself up to the newline. }
LogLine contains all the information about a line just read from a log.
func NewLogLine ¶
NewLogLine creates a new LogLine object.
type Tailer ¶
type Tailer struct {
// contains filtered or unexported fields
}
Tailer receives notification of changes from a Watcher and extracts new log lines from files. It also handles new log file creation events and log rotations.
func New ¶
func New(lines chan<- *LogLine, fs afero.Fs, w watcher.Watcher, options ...func(*Tailer) error) (*Tailer, error)
New creates a new Tailer.
func (*Tailer) AddPattern ¶
AddPattern adds a pattern to the list of patterns to filter filenames against.
func (*Tailer) SetOption ¶
SetOption takes one or more option functions and applies them in order to Tailer.
func (*Tailer) TailPattern ¶
TailPattern registers a pattern to be tailed. If pattern is a plain file then it is watched for updates and opened. If pattern is a glob, then all paths that match the glob are opened and watched, and the directories containing those matches, if any, are watched.