log

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 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 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