log

package
v2.5.3 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: GPL-3.0 Imports: 11 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 EnableStackLog

func EnableStackLog(v bool)

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 SetOutput

func SetOutput(out io.Writer)

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