Help us shape the future of Go! Take the 2026 Go Developer Survey

logger

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLogLevel

func SetLogLevel(newLevel LogLevel)

func SetLogger

func SetLogger(newLogger Backend)

Types

type Backend

type Backend interface {
	Write(prefix string, name string, msg string)
	Close()
}

Backend defines the public interface that must be implemented by all logger backends

type FileLogger

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

func NewFileLogger

func NewFileLogger(filename string) (*FileLogger, error)

func (*FileLogger) Close

func (l *FileLogger) Close()

func (*FileLogger) Write

func (l *FileLogger) Write(prefix string, name string, msg string)

type LogLevel

type LogLevel int32

LogLevel is the enum type for the log levels.

const (
	TRACE LogLevel = iota
	DEBUG
	INFO
	WARN
	ERROR
	FATAL
	NONE
)

type Logger

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

func New

func New(name string) *Logger

func (*Logger) Debug

func (l *Logger) Debug(format string, args ...interface{})

func (*Logger) Error

func (l *Logger) Error(format string, args ...interface{})

func (*Logger) Fatal

func (l *Logger) Fatal(format string, args ...interface{})

func (*Logger) Info

func (l *Logger) Info(format string, args ...interface{})

func (*Logger) LineTrace

func (l *Logger) LineTrace()

func (*Logger) Trace

func (l *Logger) Trace(format string, args ...interface{})

func (*Logger) Warn

func (l *Logger) Warn(format string, args ...interface{})

type STDIOLogger

type STDIOLogger struct {
}

func (*STDIOLogger) Close

func (l *STDIOLogger) Close()

func (*STDIOLogger) Write

func (l *STDIOLogger) Write(prefix string, name string, msg string)

Jump to

Keyboard shortcuts

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