logtailer

package
v0.3.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser extracts structured events from raw Game.log lines.

func NewParser

func NewParser() *Parser

NewParser creates a parser with all known log patterns.

func (*Parser) Parse

func (p *Parser) Parse(line string) (events.Event, bool)

Parse attempts to extract an event from a log line. Some notifications span two log lines; Parse buffers state from line 1 and emits the final event when the continuation line is matched.

func (*Parser) PatternNames added in v0.3.6

func (p *Parser) PatternNames() []string

PatternNames returns the names of all registered patterns, in order.

type Tailer

type Tailer struct {
	// contains filtered or unexported fields
}

Tailer follows a Game.log file and emits parsed events.

func New

func New(path string, bus *events.Bus) (*Tailer, error)

New creates a Tailer for the given log file path.

func (*Tailer) Run

func (t *Tailer) Run(ctx context.Context) error

Run starts tailing the log file. It seeks back to the last player_login line, replays events from that point to the current EOF to restore session state, then continues tailing for new lines. Blocks until ctx is cancelled.

func (*Tailer) RunFromStart

func (t *Tailer) RunFromStart(ctx context.Context) error

RunFromStart processes an entire log file from the beginning (for replay/analysis).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL