logging

package
Version: v0.0.0-...-8223eb1 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

The logging package is a wrapper around github.com/sirupsen/logrus that provides some convenience methods and improved error reporting.

Index

Constants

View Source
const (
	OutSocket = OutType("socket")
)

Recognized output hook types

Variables

View Source
var DefaultLogger = NewLogger(logrus.Fields{})

Functions

This section is empty.

Types

type Logger

type Logger struct {
	*logrus.Entry
}

Logger is a thin wrapper around a logrus.Entry that lets us extend and override some of Entry's methods.

func NewLogger

func NewLogger(baseFields logrus.Fields) Logger

func TestLogger

func TestLogger() Logger

func (Logger) AddHook

func (l Logger) AddHook(outType OutType, dest string) error

func (Logger) NoFields

func (l Logger) NoFields() Logger

func (Logger) SetLogOut

func (l Logger) SetLogOut(out io.Writer)

func (Logger) SubLogger

func (l Logger) SubLogger(fields logrus.Fields) Logger

func (Logger) WithError

func (l Logger) WithError(err error) Logger

func (Logger) WithErrorAndFields

func (l Logger) WithErrorAndFields(err error, fields logrus.Fields) Logger

func (Logger) WithField

func (l Logger) WithField(key string, value interface{}) Logger

func (Logger) WithFields

func (l Logger) WithFields(fields logrus.Fields) Logger

type OutType

type OutType string

type ProcessCounter

type ProcessCounter struct{}

ProcessCounter is a Logrus hook that appends a sequence number to all entries. This hook should appear before other hooks that externalize data, to ensure that they see the added fields.

func (*ProcessCounter) Fire

func (p *ProcessCounter) Fire(entry *logrus.Entry) error

func (ProcessCounter) Levels

func (ProcessCounter) Levels() []logrus.Level

type SocketHook

type SocketHook struct {
	// contains filtered or unexported fields
}

func (SocketHook) Fire

func (s SocketHook) Fire(entry *logrus.Entry) error

func (SocketHook) Levels

func (SocketHook) Levels() []logrus.Level

Jump to

Keyboard shortcuts

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