log

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// LogLevelMapping is a mapping for LogLevel enum
	LoglevelMapping = map[string]LogLevel{
		ERROR.String():   ERROR,
		WARNING.String(): WARNING,
		INFO.String():    INFO,
		DEBUG.String():   DEBUG,
		SILENT.String():  SILENT,
		FATAL.String():   FATAL,
	}
)

Functions

func Debug

func Debug(format string, v ...interface{})

func Error

func Error(format string, v ...interface{})

func Fatal

func Fatal(format string, v ...interface{})

func Info

func Info(format string, v ...interface{})

func SetLevel

func SetLevel(newLevel LogLevel)

func Subscribe

func Subscribe() observable.Subscription

func UnSubscribe

func UnSubscribe(sub observable.Subscription)

func Warn

func Warn(format string, v ...interface{})

Types

type Event

type Event struct {
	LogLevel LogLevel
	Payload  string
}

func (*Event) Type

func (e *Event) Type() string

type Event2

type Event2 struct {
	LogLevel LogLevel
	Payload  []interface{}
}

type Formatter

type Formatter struct{}

func (*Formatter) Format

func (f *Formatter) Format(entry *logrus.Entry) ([]byte, error)

type LogLevel

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

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() (interface{}, 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(interface{}) 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