logger

package
v2.5.1 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package logger provides the interface to logging facilities.

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
	LevelWarning              // 2
	LevelError                // 3
	LevelFatal                // 4
	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)
	PrintWarning(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 colorlog implements color logging.
Package colorlog implements color logging.
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