Version: v0.27.2 Latest Latest

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

Go to latest
Published: Nov 5, 2021 License: MPL-2.0 Imports: 9 Imported by: 75




This section is empty.


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

Levels are the log levels we respond to=o.


func Setup

func Setup(config *Config) error


type Config

type Config struct {
	// 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"`
	// SyslogName is the progname as it will appear in syslog output (if enabled).
	SyslogName string `json:"name"`

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