log

package
v0.0.0-...-d0ac596 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LogLevelMapping = map[string]LogLevel{
	ERROR.String():   ERROR,
	WARNING.String(): WARNING,
	INFO.String():    INFO,
	DEBUG.String():   DEBUG,
	SILENT.String():  SILENT,
}

LogLevelMapping is a mapping for LogLevel enum

View Source
var SingLogger L.ContextLogger = singLogger{}

Functions

func Debugln

func Debugln(format string, v ...any)

func Errorln

func Errorln(format string, v ...any)

func Fatalln

func Fatalln(format string, v ...any)

func Infoln

func Infoln(format string, v ...any)

func SetLevel

func SetLevel(newLevel LogLevel)

func Subscribe

func Subscribe() observable.Subscription[Event]

func UnSubscribe

func UnSubscribe(sub observable.Subscription[Event])

func Warnln

func Warnln(format string, v ...any)

Types

type Event

type Event struct {
	LogLevel LogLevel
	Payload  string
}

func (*Event) Type

func (e *Event) Type() string

type LogLevel

type LogLevel int
const (
	DEBUG LogLevel = iota
	INFO
	WARNING
	ERROR
	SILENT
)

func Level

func Level() LogLevel

func (LogLevel) MarshalJSON

func (l LogLevel) MarshalJSON() ([]byte, error)

MarshalJSON serialize LogLevel with json

func (LogLevel) MarshalYAML

func (l LogLevel) MarshalYAML() (any, error)

MarshalYAML serialize LogLevel with yaml

func (LogLevel) String

func (l LogLevel) String() string

func (*LogLevel) UnmarshalJSON

func (l *LogLevel) UnmarshalJSON(data []byte) error

UnmarshalJSON unserialize LogLevel with json

func (*LogLevel) UnmarshalYAML

func (l *LogLevel) UnmarshalYAML(unmarshal func(any) error) error

UnmarshalYAML unserialize LogLevel with yaml

Jump to

Keyboard shortcuts

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