log

package
v1.31.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

Variables

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

LogLevelMapping is a mapping for LogLevel enum

Functions

func SetLevel

func SetLevel(newLevel LogLevel)

func SetTracing

func SetTracing(t bool)

func SubscribeJson

func SubscribeJson() observable.Subscription[Event]

func SubscribeText

func SubscribeText() observable.Subscription[Event]

func UnSubscribeJson

func UnSubscribeJson(sub observable.Subscription[Event])

func UnSubscribeText

func UnSubscribeText(sub observable.Subscription[Event])

Types

type Event

type Event struct {
	LogLevel LogLevel
	Payload  string
}

func (*Event) Type

func (e *Event) Type() string

type LogLevel

type LogLevel int

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