logger

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Level

type Level int8

Level represents the severity level for a log entry.

const (
	LevelDebug   Level = iota // 0
	LevelInfo                 // 1
	LevelError                // 2
	LevelFatal                // 3
	LevelUnknown = -1
)

func LogLevel

func LogLevel(level string) Level

LogLevel matches the level string to a Level value.

func (Level) String

func (l Level) String() string

String returns a descriptive string for the severity level.

type Logger

type Logger interface {
	PrintDebug(message string, properties map[string]string)
	PrintError(err error, properties map[string]string)
	PrintFatal(err error, properties map[string]string)
	PrintInfo(message string, properties map[string]string)
	Write(message []byte) (n int, err error)
}

Logger is the interface that wraps the basic logging methods.

Directories

Path Synopsis
Package commonlog implements common logging.
Package commonlog implements common logging.
Package jsonlog implements json format logging.
Package jsonlog implements json format logging.

Jump to

Keyboard shortcuts

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