logger

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry interface {
	WithField(key string, value interface{}) Entry
	WithFields(fields map[string]interface{}) Entry
	Debugf(f string, args ...interface{})
	Infof(f string, args ...interface{})
	Errorf(f string, args ...interface{})
}

type HoneycombEntry

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

func (*HoneycombEntry) Debugf

func (h *HoneycombEntry) Debugf(f string, args ...interface{})

func (*HoneycombEntry) Errorf

func (h *HoneycombEntry) Errorf(f string, args ...interface{})

func (*HoneycombEntry) Infof

func (h *HoneycombEntry) Infof(f string, args ...interface{})

func (*HoneycombEntry) WithField

func (h *HoneycombEntry) WithField(key string, value interface{}) Entry

func (*HoneycombEntry) WithFields

func (h *HoneycombEntry) WithFields(fields map[string]interface{}) Entry

type HoneycombLevel

type HoneycombLevel int
const (
	UnknownLevel HoneycombLevel = iota
	DebugLevel
	InfoLevel
	WarnLevel
	ErrorLevel
	PanicLevel
)

type HoneycombLogger

type HoneycombLogger struct {
	Config            config.Config   `inject:""`
	UpstreamTransport *http.Transport `inject:"upstreamTransport"`
	Version           string          `inject:"version"`
	// contains filtered or unexported fields
}

HoneycombLogger is a Logger implementation that sends all logs to a Honeycomb dataset. It requires a HoneycombLogger section of the config to exist with three keys, LoggerHoneycombAPI, LoggerAPIKey, and LoggerDataset.

func (*HoneycombLogger) Debugf

func (h *HoneycombLogger) Debugf(f string, args ...interface{})

func (*HoneycombLogger) Errorf

func (h *HoneycombLogger) Errorf(f string, args ...interface{})

func (*HoneycombLogger) Infof

func (h *HoneycombLogger) Infof(f string, args ...interface{})

func (*HoneycombLogger) SetLevel

func (h *HoneycombLogger) SetLevel(level string) error

func (*HoneycombLogger) Start

func (h *HoneycombLogger) Start() error

func (*HoneycombLogger) Stop

func (h *HoneycombLogger) Stop() error

func (*HoneycombLogger) WithField

func (h *HoneycombLogger) WithField(key string, value interface{}) Entry

func (*HoneycombLogger) WithFields

func (h *HoneycombLogger) WithFields(fields map[string]interface{}) Entry

type HoneycombLoggerConfig

type HoneycombLoggerConfig struct {
	LoggerHoneycombAPI string
	LoggerAPIKey       string
	LoggerDataset      string
	// contains filtered or unexported fields
}

type Logger

type Logger interface {
	WithField(key string, value interface{}) Entry
	WithFields(fields map[string]interface{}) Entry
	Debugf(f string, args ...interface{})
	Infof(f string, args ...interface{})
	Errorf(f string, args ...interface{})
	// SetLevel sets the logging level (debug, info, warn, error)
	SetLevel(level string) error
}

func GetLoggerImplementation

func GetLoggerImplementation(c config.Config) Logger

type LogrusEntry

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

func (*LogrusEntry) Debugf

func (l *LogrusEntry) Debugf(f string, args ...interface{})

func (*LogrusEntry) Errorf

func (l *LogrusEntry) Errorf(f string, args ...interface{})

func (*LogrusEntry) Infof

func (l *LogrusEntry) Infof(f string, args ...interface{})

func (*LogrusEntry) WithField

func (l *LogrusEntry) WithField(key string, value interface{}) Entry

func (*LogrusEntry) WithFields

func (l *LogrusEntry) WithFields(fields map[string]interface{}) Entry

type LogrusLogger

type LogrusLogger struct {
	Config config.Config `inject:""`
	// contains filtered or unexported fields
}

LogrusLogger is a Logger implementation that sends all logs to stdout using the Logrus package to get nice formatting

func (*LogrusLogger) Debugf

func (l *LogrusLogger) Debugf(f string, args ...interface{})

func (*LogrusLogger) Errorf

func (l *LogrusLogger) Errorf(f string, args ...interface{})

func (*LogrusLogger) Infof

func (l *LogrusLogger) Infof(f string, args ...interface{})

func (*LogrusLogger) SetLevel

func (l *LogrusLogger) SetLevel(level string) error

func (*LogrusLogger) Start

func (l *LogrusLogger) Start() error

func (*LogrusLogger) WithField

func (l *LogrusLogger) WithField(key string, value interface{}) Entry

func (*LogrusLogger) WithFields

func (l *LogrusLogger) WithFields(fields map[string]interface{}) Entry

type NullLogger

type NullLogger struct{}

func (*NullLogger) Debugf

func (n *NullLogger) Debugf(string, ...interface{})

func (*NullLogger) Errorf

func (n *NullLogger) Errorf(string, ...interface{})

func (*NullLogger) Infof

func (n *NullLogger) Infof(string, ...interface{})

func (*NullLogger) SetLevel

func (n *NullLogger) SetLevel(string) error

func (*NullLogger) WithField

func (n *NullLogger) WithField(key string, value interface{}) Entry

func (*NullLogger) WithFields

func (n *NullLogger) WithFields(fields map[string]interface{}) Entry

type NullLoggerEntry

type NullLoggerEntry struct{}

func (*NullLoggerEntry) Debugf

func (n *NullLoggerEntry) Debugf(string, ...interface{})

func (*NullLoggerEntry) Errorf

func (n *NullLoggerEntry) Errorf(string, ...interface{})

func (*NullLoggerEntry) Infof

func (n *NullLoggerEntry) Infof(string, ...interface{})

func (*NullLoggerEntry) WithField

func (n *NullLoggerEntry) WithField(key string, value interface{}) Entry

func (*NullLoggerEntry) WithFields

func (n *NullLoggerEntry) WithFields(fields map[string]interface{}) Entry

Jump to

Keyboard shortcuts

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