logger

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 4 Imported by: 10 modules, 7 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

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 added in v0.1.4

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

func NewFileLogger added in v0.1.4

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

func (*FileLogger) Close added in v0.1.7

func (l *FileLogger) Close()

func (*FileLogger) Write added in v0.1.7

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 added in v0.1.4

type STDIOLogger struct {
}

func (*STDIOLogger) Close added in v0.1.7

func (l *STDIOLogger) Close()

func (*STDIOLogger) Write added in v0.1.7

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