varasto: github.com/function61/varasto/pkg/logtee Index | Files

package logtee

import "github.com/function61/varasto/pkg/logtee"

Plumbing for teeing/tailing log messages. Plop this between your root logger and stderr and you'll be tailing log messages efficiently and programmatically for e.g. your GUI

Index

Package Files

linesplittertee.go stringtail.go

func NewLineSplitterTee Uses

func NewLineSplitterTee(sink io.Writer, lineCompleted func(string)) io.Writer

returns io.Writer that tees full lines to lineCompleted callback

type StringTail Uses

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

func NewStringTail Uses

func NewStringTail(capacity int) *StringTail

keeps only "capacity" last Write() calls (which you can retrieve with Snapshot() )

func (*StringTail) Snapshot Uses

func (t *StringTail) Snapshot() []string

func (*StringTail) Write Uses

func (t *StringTail) Write(line string)

Package logtee imports 4 packages (graph) and is imported by 2 packages. Updated 2020-09-07. Refresh now. Tools for package owners.