log

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close() error

func Critical

func Critical(message string)

func CriticalF

func CriticalF(message string, f ...any)

func Debug

func Debug(message string)

func DebugF

func DebugF(message string, f ...any)

func Error

func Error(message string)

func ErrorF

func ErrorF(message string, f ...any)

func Fatal

func Fatal(message string)

func FatalF

func FatalF(message string, f ...any)

func Info

func Info(message string)

func InfoF

func InfoF(message string, f ...any)

func SetDefaultLogger

func SetDefaultLogger(logger Logger)

func Warn

func Warn(message string)

func WarnF

func WarnF(message string, f ...any)

Types

type Level

type Level int
const (
	LevelTrace Level = iota - 1
	LevelDebug
	LevelInfo
	LevelWarn
	LevelError
	LevelCritical
	LevelFatal
)

func OfLevel

func OfLevel(level string) Level

func (Level) MarshalJSON

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

func (Level) MarshalYAML

func (l Level) MarshalYAML() (interface{}, error)

func (Level) String

func (l Level) String() string

func (Level) StringC

func (l Level) StringC() string

func (*Level) UnmarshalJSON

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

func (*Level) UnmarshalYAML

func (l *Level) UnmarshalYAML(unmarshal func(interface{}) error) error

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

func New

func New(settings *Settings) (*Logger, error)

func (*Logger) Close

func (l *Logger) Close() error

type Settings

type Settings struct {
	Level      Level
	Format     string
	LogPath    string
	PanicLevel Level
}

Jump to

Keyboard shortcuts

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