log

package
v0.0.0-...-0b2e9e9 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2020 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package log adds a thin wrapper around logrus to improve non-debug logging performance.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(v interface{}, fielders ...Fielder)

Debug logs at the debug level if debug logging is enabled.

func Error

func Error(v interface{}, fielders ...Fielder)

Error logs at the error level.

func Fatal

func Fatal(v interface{}, fielders ...Fielder)

Fatal logs at the fatal level and exits with a status code != 0.

func Info

func Info(v interface{}, fielders ...Fielder)

Info logs at the info level.

func SetDebug

func SetDebug(to bool)

SetDebug controls debug logging.

func SetFormatter

func SetFormatter(to logrus.Formatter)

SetFormatter sets the formatter.

func SetOutput

func SetOutput(to io.Writer)

SetOutput sets the output.

func Warn

func Warn(v interface{}, fielders ...Fielder)

Warn logs at the warning level.

Types

type Fielder

type Fielder interface {
	LogFields() Fields
}

A Fielder provides Fields via the LogFields method.

func Err

func Err(e error) Fielder

Err is a wrapper around errors that implements Fielder.

type Fields

type Fields map[string]interface{}

Fields is a map of logging fields.

func (Fields) LogFields

func (f Fields) LogFields() Fields

LogFields implements Fielder for Fields.

Jump to

Keyboard shortcuts

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