logging

package
v2.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2023 License: MPL-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrLogLineToLong = errors.New("log line too long, discarding")
)

Functions

func JSONToLog

func JSONToLog(l zerolog.Logger, msg map[string]any)

Types

type LogReader

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

logReader is a custom implementation similar to bufio.Scanner, but provides a way to handle lines (or tokens) that exceed the buffer size.

func NewLogReader

func NewLogReader(reader io.ReadCloser) *LogReader

newLogReader creates a new logReader to read log lines from an io.ReadCloser

func (*LogReader) NextLine

func (r *LogReader) NextLine() ([]byte, error)

NextLine reads and returns the next log line from the reader. An io.EOF error is returned if the end of the stream has been reached. This implementation is different from bufio.Scanner as it also returns an error if a line is too long to fit into the buffer. In this case, an error is returned together with a limited prefix of the line.

Jump to

Keyboard shortcuts

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