logger

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2025 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

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

Channel is Logger sensing messages to be logged over a channel.

func NewChannel

func NewChannel(ch chan<- LogMessage) Channel

NewChannel creates a new Channel Logger logging to ch.

WARNING: If the channel gets full, the write of log message will block. Consequently, it's absolutely necessary to provide a channel with sufficient capacity and to guarantee that messages from it are consumed.

func (Channel) Errorf

func (c Channel) Errorf(format string, args ...interface{})

type DefaultLog

type DefaultLog struct{}

Log is Logger using default standard logger provided by Go standard log package.

func NewDefaultLog

func NewDefaultLog() *DefaultLog

NewDefaultLog returns instance of Log using default logger of Go standard log package.

func (*DefaultLog) Errorf

func (*DefaultLog) Errorf(format string, args ...interface{})

type Log

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

Log is Logger using standard logger provided by Go standard log package.

func NewLog

func NewLog(l *log.Logger) *Log

NewLog creates new Log using l for logging.

func (*Log) Errorf

func (l *Log) Errorf(format string, args ...interface{})

type LogMessage

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

LogMessage represents a single log message to be logger.

This structure groups parameters of a single log line to allow sending them over a channel.

type Logger

type Logger interface {
	Errorf(format string, args ...interface{})
}

Logger is any object with ability to log internal errors and warnings.

type Nop

type Nop struct{}

Nop is Logger implementation which never logs.

func NewNop

func NewNop() *Nop

NewNop returns a Nop logger.

func (*Nop) Errorf

func (*Nop) Errorf(_ string, _ ...interface{})

Jump to

Keyboard shortcuts

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