log

package
v2.0.0-...-f08b0b4 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2022 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debugf

func Debugf(format string, args ...any)

func Errorf

func Errorf(format string, args ...any)

func Fatalf

func Fatalf(format string, args ...any)

func Infof

func Infof(format string, args ...any)

func SetLevel

func SetLevel(level Level)

func Subscribe

func Subscribe() observable.Subscription

func UnSubscribe

func UnSubscribe(sub observable.Subscription)

func Warnf

func Warnf(format string, args ...any)

Types

type Event

type Event struct {
	Level   Level     `json:"level"`
	Message string    `json:"msg"`
	Time    time.Time `json:"time"`
}

type Level

type Level uint32
const (
	SilentLevel Level = iota
	ErrorLevel
	WarnLevel
	InfoLevel
	DebugLevel
)

func ParseLevel

func ParseLevel(lvl string) (Level, error)

func (Level) MarshalJSON

func (level Level) MarshalJSON() ([]byte, error)

MarshalJSON serialize Level with json

func (Level) String

func (level Level) String() string

func (*Level) UnmarshalJSON

func (level *Level) UnmarshalJSON(data []byte) error

UnmarshalJSON deserialize Level with json

Jump to

Keyboard shortcuts

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