log

package
v2.5.2 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: GPL-3.0 Imports: 11 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debugf

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

func EnableStackLog added in v2.5.0

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 added in v2.5.1

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