log

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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 Output

func Output(depth int, lev slog.Level, format string, v ...any)

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)
	Output(depth int, lev slog.Level, msg string, v ...any)
}
var DefaultLogger Logger = NewSLogger(1)

func NewSLogger

func NewSLogger(depth int) Logger

Jump to

Keyboard shortcuts

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