log

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendField

func AppendField(key string, value interface{})

AppendField appends a field

func Debug

func Debug(args ...interface{})

Debug logging

func Debugf

func Debugf(msg string, args ...interface{})

Debugf logging

func Error

func Error(args ...interface{})

Error logging

func Errorf

func Errorf(msg string, args ...interface{})

Errorf logging

func Fatal

func Fatal(args ...interface{})

Fatal logging

func Fatalf

func Fatalf(msg string, args ...interface{})

Fatalf logging

func Info

func Info(args ...interface{})

Info logging

func Infof

func Infof(msg string, args ...interface{})

Infof logging

func Panic

func Panic(args ...interface{})

Panic logging

func Panicf

func Panicf(msg string, args ...interface{})

Panicf logging

func Setup

func Setup(f Factory) error

Setup set's up a new factory to the global state

func Warn

func Warn(args ...interface{})

Warn logging

func Warnf

func Warnf(msg string, args ...interface{})

Warnf logging

Types

type Factory

type Factory interface {
	Create(map[string]interface{}) Logger
	CreateSub(Logger, map[string]interface{}) Logger
}

Factory interface defines the interface that we have to provide in order to use this abstraction

type Level

type Level string

The Level type definition.

const (
	// DebugLevel level.
	DebugLevel Level = "debug"
	// InfoLevel level.
	InfoLevel Level = "info"
	// WarnLevel level.
	WarnLevel Level = "warn"
	// ErrorLevel level.
	ErrorLevel Level = "error"
	// FatalLevel level.
	FatalLevel Level = "fatal"
	// PanicLevel level.
	PanicLevel Level = "panic"
	// NoLevel level.
	NoLevel Level = ""
)

type Logger

type Logger interface {
	Level() Level
	Fields() map[string]interface{}
	Fatal(...interface{})
	Fatalf(string, ...interface{})
	Panic(...interface{})
	Panicf(string, ...interface{})
	Error(...interface{})
	Errorf(string, ...interface{})
	Warn(...interface{})
	Warnf(string, ...interface{})
	Info(...interface{})
	Infof(string, ...interface{})
	Debug(...interface{})
	Debugf(string, ...interface{})
}

Logger interface defines all methods a logger has to implement for this abstraction

func Sub

func Sub(fields map[string]interface{}) Logger

Sub returns a new sub logger

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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