log

package
v0.0.0-...-0d9a822 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Log

func Log(level Level, s string, fields ...Field) error

func SetLogger

func SetLogger(logger Logger)

Types

type Field

type Field interface {
	Key() string
	Value() any
}

func FieldKv

func FieldKv(key string, value any) Field

type Level

type Level int8

Level is a logger level.

const (
	// LevelDebug is logger debug level.
	LevelDebug Level = iota
	// LevelInfo is logger info level.
	LevelInfo
	// LevelWarn is logger warn level.
	LevelWarn
	// LevelError is logger error level.
	LevelError
	// LevelFatal is logger fatal level
	LevelFatal
)

func (Level) String

func (l Level) String() string

type Logger

type Logger interface {
	Log(level Level, s string, fields ...Field) error
}

Jump to

Keyboard shortcuts

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