logging

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2016 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Levels = []logutils.LogLevel{"DEBUG", "INFO", "WARN", "ERR"}

Levels are the log levels we respond to=o.

Functions

func NewLogFilter

func NewLogFilter() *logutils.LevelFilter

NewLogFilter returns a LevelFilter that is configured with the log levels that we use.

func Setup

func Setup(config *Config) error

func ValidateLevelFilter

func ValidateLevelFilter(min logutils.LogLevel, filter *logutils.LevelFilter) bool

ValidateLevelFilter verifies that the log levels within the filter are valid.

Types

type Config

type Config struct {
	// Name is the progname as it will appear in syslog output (if enabled).
	Name string `json:"name"`

	// Level is the log level to use.
	Level string `json:"level"`

	// Syslog and SyslogFacility are the syslog configuration options.
	Syslog         bool   `json:"syslog"`
	SyslogFacility string `json:"syslog_facility"`

	// Writer is the output where logs should go. If syslog is enabled, data will
	// be written to writer in addition to syslog.
	Writer io.Writer `json:"-"`
}

Config is the configuration for this log setup.

type SyslogWrapper

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

SyslogWrapper is used to cleaup log messages before writing them to a Syslogger. Implements the io.Writer interface.

func (*SyslogWrapper) Write

func (s *SyslogWrapper) Write(p []byte) (int, error)

Write is used to implement io.Writer.

Jump to

Keyboard shortcuts

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