pkglog

package
v0.0.0-...-15a92f0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2016 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupLogging

func SetupLogging(appName string, env Env) error

SetupLogging sets up logging.

Types

type Env

type Env struct {
	// DisableStderrLog says to disable logging to stderr.
	DisableStderrLog bool `env:"DISABLE_STDERR_LOG"`
	// The directory to write rotating logs to.
	// If not set and SyslogNetwork and SyslogAddress not set, logs will be to stderr.
	LogDir string `env:"LOG_DIR"`
	// The syslog network, either udp or tcp.
	// Must be set with SyslogAddress.
	// If not set and LogDir not set, logs will be to stderr.
	SyslogNetwork string `env:"SYSLOG_NETWORK"`
	// The syslog host:port.
	// Must be set with SyslogNetwork.
	// If not set and LogDir not set, logs will be to stderr.
	SyslogAddress string `env:"SYSLOG_ADDRESS"`
	// The level to log at, must be one of DEBUG, INFO, WARN, ERROR, FATAL, PANIC.
	LogLevel string `env:"LOG_LEVEL"`
}

Env defines a struct for environment variables that can be parsed with go.pedge.io/env.

Jump to

Keyboard shortcuts

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