Documentation
¶
Overview ¶
Package logs aggregates and formats log streams from multiple sources.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LogAggregator ¶
LogAggregator formats and writes log lines from multiple sources.
func NewAggregator ¶
func NewAggregator(out io.Writer, appName string) *LogAggregator
NewAggregator returns a LogAggregator that writes formatted logs to out.
func (*LogAggregator) GetWriter ¶
func (a *LogAggregator) GetWriter(source LogSource) io.Writer
GetWriter returns an io.Writer that tags all writes with source.
func (*LogAggregator) WriteSource ¶
func (a *LogAggregator) WriteSource(source LogSource, p []byte) (n int, err error)
WriteSource formats and writes each non-empty line in p tagged with source.
type SourceWriter ¶
type SourceWriter struct {
// contains filtered or unexported fields
}
SourceWriter implements io.Writer for a specific source.