log

package
v0.0.0-...-e4508ab Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package log provides an interface and a few helper functions/constants.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Log

func Log(log Logger, level LogLevel, msg string, fields Fields)

Log is an internal helper function to be used by this library.

Types

type Fields

type Fields map[string]interface{}

Fields is a map of key value pairs of extra information worthwhile logging.

type LogLevel

type LogLevel uint

LogLevel defines the log level constants.

const (
	TRACE LogLevel = 10
	DEBUG LogLevel = 20
	INFO  LogLevel = 30
	WARN  LogLevel = 40
	ERROR LogLevel = 50
)

LogLevels constants

type Logger

type Logger interface {
	Trace(msg string, fields Fields)
	Debug(msg string, fields Fields)
	Info(msg string, fields Fields)
	Warn(msg string, fields Fields)
	Error(msg string, fields Fields)
}

Logger is the logger interface that should be used by libraries to log.

Jump to

Keyboard shortcuts

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