logger

package
Version: v0.0.0-...-459cbd0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2021 License: Apache-2.0, BSD-2-Clause-Views, BSD-3-Clause, MIT Imports: 4 Imported by: 51

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RFC3339Formatter

func RFC3339Formatter(key string) zap.TimeFormatter

func UnixEpochFormatter

func UnixEpochFormatter(key string) zap.TimeFormatter

Types

type LagerAdapter

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

LagerAdapter satisfies the lager.Logger interface with zap as the implementation.

func NewLagerAdapter

func NewLagerAdapter(zapLogger Logger) *LagerAdapter

NewLagerAdapter returns a new lager.Logger that uses zap underneath.

func (*LagerAdapter) Debug

func (l *LagerAdapter) Debug(action string, data ...lager.Data)

Debug logs a message at the debug log level.

func (*LagerAdapter) Error

func (l *LagerAdapter) Error(action string, err error, data ...lager.Data)

Error logs a message at the error log level.

func (*LagerAdapter) Fatal

func (l *LagerAdapter) Fatal(action string, err error, data ...lager.Data)

Fatal logs a message and exits with status 1.

func (*LagerAdapter) Info

func (l *LagerAdapter) Info(action string, data ...lager.Data)

Info logs a message at the info log level.

func (*LagerAdapter) RegisterSink

func (l *LagerAdapter) RegisterSink(_ lager.Sink)

RegisterSink is never used after initialization, so it does nothing.

func (*LagerAdapter) Session

func (l *LagerAdapter) Session(task string, data ...lager.Data) lager.Logger

Session returns a new logger with a nested session.

func (*LagerAdapter) SessionName

func (l *LagerAdapter) SessionName() string

SessionName returns the name of the logger session

func (*LagerAdapter) WithData

func (l *LagerAdapter) WithData(data lager.Data) lager.Logger

WithData returns a logger with newly added data.

type Logger

type Logger interface {
	With(...zap.Field) Logger
	Check(zap.Level, string) *zap.CheckedMessage
	Log(zap.Level, string, ...zap.Field)
	Debug(string, ...zap.Field)
	Info(string, ...zap.Field)
	Warn(string, ...zap.Field)
	Error(string, ...zap.Field)
	DPanic(string, ...zap.Field)
	Panic(string, ...zap.Field)
	Fatal(string, ...zap.Field)
	Session(string) Logger
	SessionName() string
}

Logger is the zap.Logger interface with additional Session methods.

func NewLogger

func NewLogger(component string, timestampFormat string, options ...zap.Option) Logger

NewLogger returns a new zap logger that implements the Logger interface.

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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