logutils

package
v2.0.0-beta-rc1+incomp... Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2016 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureEarlyLogging

func ConfigureEarlyLogging()

ConfigureEarlyLogging does minimal logging config for early startup. It either disables non-panic logging entirely or, if the FELIX_LOGSEVERITYSCREEN environment variable is set, enables the given log level to screen.

func ConfigureLogging

func ConfigureLogging(configParams *config.Config)

ConfigureLogging uses the resolved configuration to complete the logging configuration. It creates hooks for the relevant logging targets and attaches them to logrus.

Types

type ContextHook

type ContextHook struct {
}

func (ContextHook) Fire

func (hook ContextHook) Fire(entry *log.Entry) error

func (ContextHook) Levels

func (hook ContextHook) Levels() []log.Level

type Formatter

type Formatter struct{}

Formatter is our custom log formatter, which mimics the style used by the Python version of Felix. In particular, it uses a sortable timestamp and logs the level and PID. Since logrus deosn't yet expose file and line numbers, we log "go" as a placeholder.

2016-10-04 14:45:45,999 [ERROR][70826] go: Hello world key=value

func (*Formatter) Format

func (f *Formatter) Format(entry *log.Entry) ([]byte, error)

type LeveledHook

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

func (*LeveledHook) Fire

func (h *LeveledHook) Fire(entry *log.Entry) error

func (*LeveledHook) Levels

func (h *LeveledHook) Levels() []log.Level

type NullWriter

type NullWriter struct{}

NullWriter is a dummy writer that always succeeds and does nothing.

func (*NullWriter) Write

func (w *NullWriter) Write(p []byte) (int, error)

type StreamHook

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

StreamHook is a logrus Hook that writes to a stream when fired. It supports configuration of log levels at which is fires.

func (*StreamHook) Fire

func (h *StreamHook) Fire(entry *log.Entry) (err error)

func (*StreamHook) Levels

func (h *StreamHook) Levels() []log.Level

Jump to

Keyboard shortcuts

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