log

package
v0.19.6 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

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

func Error

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

func Fatal

func Fatal(msg string, kv ...any)

func Info

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

func SetFormat

func SetFormat(format Format)

func SetLevel

func SetLevel(level Level)

func Warn

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

Types

type Format

type Format string
const (
	FormatText Format = "text"
	FormatJSON Format = "json"
)

func ParseFormat added in v0.13.1

func ParseFormat(s string) (Format, bool)

func (Format) String

func (e Format) String() string

type Level

type Level int
const (
	LevelDebug Level = 0
	LevelInfo  Level = 1
	LevelWarn  Level = 2
	LevelError Level = 3
	LevelFatal Level = 4
)

func (Level) String

func (e Level) String() string

type Logger

type Logger struct {
	W      *os.File
	Level  Level
	Format Format
}

func New

func New(w *os.File) Logger

func (Logger) Debug

func (l Logger) Debug(msg string, kv ...any)

func (Logger) Error

func (l Logger) Error(msg string, kv ...any)

func (Logger) Fatal

func (l Logger) Fatal(msg string, kv ...any)

func (Logger) Info

func (l Logger) Info(msg string, kv ...any)

func (Logger) Warn

func (l Logger) Warn(msg string, kv ...any)

Jump to

Keyboard shortcuts

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