log

package
v1.18.10 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: GPL-3.0 Imports: 9 Imported by: 7

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) MarshalText added in v1.18.9

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

MarshalText serialize LogLevel

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) UnmarshalText added in v1.18.9

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

UnmarshalText unserialize LogLevel

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