logging

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2015 License: MPL-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

	// Level is the log level to use.
	Level string

	// Syslog and SyslogFacility are the syslog configuration options.
	Syslog         bool
	SyslogFacility string

	// 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
}

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