log

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OutputStderr bool = true

Functions

func Close

func Close() error

func Debug

func Debug(msg string, v ...any)

func Error

func Error(msg string, v ...any)

func IfErr added in v0.3.3

func IfErr(msg string, f func() error, ignoreErr ...error)

func Info

func Info(msg string, v ...any)

func NewPath

func NewPath(path string) logPath

func NewSLoggerWithHandler added in v0.3.7

func NewSLoggerWithHandler(h slog.Handler, depth int) *slogger

func Set

func Set(config *protolog.Logcat, path string)

func Warn

func Warn(msg string, v ...any)

Types

type FileWriter

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

func NewLogWriter

func NewLogWriter(file string) *FileWriter

func (*FileWriter) Close

func (f *FileWriter) Close() error

func (*FileWriter) Write

func (f *FileWriter) Write(p []byte) (n int, err error)

type Logger

type Logger interface {
	Debug(string, ...any)
	Info(string, ...any)
	Warn(string, ...any)
	Error(string, ...any)
	Enabled(level slog.Level) bool
}
var DefaultLogger Logger = NewSLogger(1)

func NewSLogger

func NewSLogger(depth int) Logger

type LoggerAdvanced added in v0.3.7

type LoggerAdvanced interface {
	Logger
	SetLevel(l slog.Level)
	SetOutput(io.Writer)
}

type LoggerOutput added in v0.3.7

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

func Select added in v0.3.7

func Select(level slog.Level) LoggerOutput

func (LoggerOutput) Print added in v0.3.7

func (f LoggerOutput) Print(msg string, v ...any)

func (LoggerOutput) PrintFunc added in v0.3.7

func (f LoggerOutput) PrintFunc(msg string, ff func() []any)

Jump to

Keyboard shortcuts

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