byolog

package module
v0.0.0-...-bdfbc4a Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2018 License: MIT Imports: 0 Imported by: 0

README

Bring Your Own Log (BYOLOG)

This package aims to provide a useful abstraction over various logging libraries.

Godoc

https://godoc.org/github.com/gordonmleigh/byolog

Why?

  1. Logging should be simple
  2. A package dependency shouldn't force you to use a certain logging library

The external dependencies of a given library should be replaceable. A package depending on byolog.Logger can use any logging library that an implementation has been written for (see output).

What loggers can I use?

See output/ folder.

Contributions

PRs welcome for broader output support.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	Name  string
	Value interface{}
}

Field represents a field for structured logging.

func NewField

func NewField(name string, value interface{}) Field

NewField creates a new field.

type Logger

type Logger interface {
	Error(msg string, fields ...Field)
	Warn(msg string, fields ...Field)
	Info(msg string, fields ...Field)
	Debug(msg string, fields ...Field)
	With(fields ...Field) Logger
	Named(name string) Logger
}

Logger represents any structured logger.

func Nop

func Nop() Logger

Nop creates a logger which satisfies the interface and does nothing.

Directories

Path Synopsis
output
zap

Jump to

Keyboard shortcuts

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