log

package
v0.0.0-...-9f5570a Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(msg string)

func Debugf

func Debugf(msg string, v ...interface{})

func Error

func Error(msg string)

func Errorf

func Errorf(msg string, v ...interface{})

func Fatal

func Fatal(msg string)

func Fatalf

func Fatalf(msg string, v ...interface{})

func Info

func Info(msg string)

func Infof

func Infof(msg string, v ...interface{})

func SetLevel

func SetLevel(level Level)

func Warn

func Warn(msg string)

func Warnf

func Warnf(msg string, v ...interface{})

Types

type Entry

type Entry struct {
	ID      uint64    `json:"id"`
	Time    time.Time `json:"time"`
	Level   Level     `json:"level"`
	Message string    `json:"message"`
}

Entry represents a single log entry.

func NewEntry

func NewEntry(id uint64, level Level, message string) *Entry

type ILog

type ILog interface {
	Log(e *Entry) error
}

type Level

type Level int

Level of severity.

const (
	InvalidLevel Level = iota - 1
	DebugLevel
	InfoLevel
	WarnLevel
	ErrorLevel
	FatalLevel
)

Log levels.

func GetLevel

func GetLevel() Level

type Logger

type Logger struct {
	Log ILog `inject:""`
}

func GetLogger

func GetLogger() *Logger

Jump to

Keyboard shortcuts

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