logging

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorLocationHook

type ErrorLocationHook struct {
}

ErrorLocationHook is a logrus hook that attaches error location information to log entries if an error is being logged and it has stack-trace information (i.e. if it originates from or is wrapped by github.com/pkg/errors).

func (*ErrorLocationHook) Fire

func (h *ErrorLocationHook) Fire(entry *logrus.Entry) error

func (*ErrorLocationHook) Levels

func (h *ErrorLocationHook) Levels() []logrus.Level

type HcLogLevelHook added in v0.6.0

type HcLogLevelHook struct{}

HcLogLevelHook adds an hclog-compatible field ("@level") containing the log level. Note that if you use this, you SHOULD NOT use logrus.JSONFormatter's FieldMap to set the level key to "@level" because that will result in the hclog-compatible info written here being overwritten.

func (*HcLogLevelHook) Fire added in v0.6.0

func (h *HcLogLevelHook) Fire(entry *logrus.Entry) error

func (*HcLogLevelHook) Levels added in v0.6.0

func (h *HcLogLevelHook) Levels() []logrus.Level

type LogLocationHook

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

LogLocationHook is a logrus hook that attaches location information to log entries, i.e. the file and line number of the logrus log call. This hook is designed for use in both the Ark server and Ark plugin implementations. When triggered within a plugin, a marker field will be set on the log entry indicating that the location came from a plugin. The Ark server instance will not overwrite location information if it sees this marker.

func (*LogLocationHook) Fire

func (h *LogLocationHook) Fire(entry *logrus.Entry) error

func (*LogLocationHook) Levels

func (h *LogLocationHook) Levels() []logrus.Level

func (*LogLocationHook) WithLoggerName added in v0.6.0

func (h *LogLocationHook) WithLoggerName(name string) *LogLocationHook

WithLoggerName gives the hook a name to use when setting the marker field on a log entry indicating the location has been recorded by a plugin. This should only be used when setting up a hook for a logger used in a plugin.

type LogSetter added in v0.6.0

type LogSetter interface {
	SetLog(logrus.FieldLogger)
}

LogSetter is an interface for a type that allows a FieldLogger to be set on it.

Jump to

Keyboard shortcuts

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