log

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2023 License: GPL-3.0 Imports: 5 Imported by: 9

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,
	}
)

Functions

func D

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

func Debug

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

func E

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

func Error

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

func I

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

func SetLevel

func SetLevel(newLevel LogLevel)

func W

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

func Warnln

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

func Write

func Write(msg Message)

Write a simple logger

Types

type LogLevel

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

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

type Message

type Message interface {
	String() string
}

Jump to

Keyboard shortcuts

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