logger

package module
v0.1.0 Latest Latest
Warning

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

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

Documentation

Overview

The point of this package is to create a layer of abstraction on top of your favorite Go logging library, so that you can use your favorite logging library in Trinkets. A valid Logger implementation needs only 2 methods: * Info(string, ...interface{}) * Error(string, ...interface{})

To enable this you would use:

logger.SetupLogBuilder(func(name string) logger.Logger {
	return your.Logger(name)
})

Index

Constants

This section is empty.

Variables

View Source
var NewLogger logBuilderType

NewLogger builder function

Functions

func SetupLogBuilder

func SetupLogBuilder(b logBuilderType)

SetupLogBuilder helper is used for setting up the log builder function

Types

type Attrs

type Attrs map[string]interface{}

Attrs are used for providing additional info in the log messages

type Logger

type Logger interface {
	Info(string, ...interface{})
	Error(string, ...interface{})
}

Logger types must support Info and Error functions

Jump to

Keyboard shortcuts

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