Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ColorPicker ¶
ColorPicker returns a color.
func DefaultColorPicker ¶
func DefaultColorPicker() ColorPicker
DefaultColorPicker create a color picker to get a color from a default colors set.
type Follower ¶
type Follower interface {
// Follow reads the last `lines` lines from the log file and prints them.
// It continues to follow the log file, printing new lines as they are added,
// keeps working until context `Done`.
Follow(ctx context.Context, lines int) (<-chan string, error)
// Wait waits for the follower to finish processing.
Wait()
}
Follower is an interface for reading and following log files.
func NewTailFollower ¶
NewTailFollower creates a new Follower that handle file with tail library.
type LogFormatter ¶
LogFormatter is a function used to format log string before output.
func NewLogFormatter ¶
func NewLogFormatter(prefix string, color color.Color) LogFormatter
NewLogFormatter creates a function to make log prefix colored.
type Reader ¶
type Reader interface {
// Read reads the last `lines` lines from the file and returns a channel with raw strings.
Read(ctx context.Context, lines int) (<-chan string, error)
}
Reader is an interface for reading the last `lines` lines from a file.
func NewTailReader ¶
NewTailReader creates a new Tailer that reads the last lines from the file with tail library.
Click to show internal directories.
Click to hide internal directories.