logging

package
v0.0.0-...-8b4df74 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogWriter

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

LogWriter implements the io.Writer interface by passing each line to the Logger after it hits a line break ('\n').

func NewLogWriter

func NewLogWriter(logger Logger) *LogWriter

NewLogWriter creates a LogWriter using the logger provided

func (*LogWriter) Flush

func (w *LogWriter) Flush() error

Flush a log line out and empty the buffer

func (*LogWriter) Write

func (w *LogWriter) Write(p []byte) (n int, err error)

Writes to the string buffer, and passes each line to the logger after it reaches a new line

type Logger

type Logger interface {
	Log(msg string)
}

Logger logs messages

type StandardLogger

type StandardLogger struct {
	// Logger may be provided optionally to customize the standard logger
	// If it is nil, the global default logger will be used
	Logger *log.Logger
}

StandardLogger implements the Logger interfaces using the standard library "log" package

func (*StandardLogger) Log

func (l *StandardLogger) Log(msg string)

Log a line to the standard logger

Jump to

Keyboard shortcuts

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