logging

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: May 26, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConsoleOutput = func(config *loggerConfig) {
	config.output = "console"
}
View Source
var JsonFormat = func(config *loggerConfig) {
	config.format = "json"
}

Functions

func ApplyLoggerProperties

func ApplyLoggerProperties(properties *LoggerProperties) loggerOpt

func ApplyProperties

func ApplyProperties(properties *Properties) loggingOpt

func Configure

func Configure(opts ...loggingOpt)

func Field

func Field(name, value string) loggingOpt

func Fields

func Fields(fields map[string]string) loggingOpt

func FileOutput

func FileOutput(location string) loggerOpt

func GelfOutput

func GelfOutput(protocol, address, tag string) loggerOpt

func Level added in v1.0.3

func Level(level string) loggingOpt

func Logger

func Logger(opts ...loggerOpt) *logger

func Loggers

func Loggers(loggers ...*logger) loggingOpt

func TextFormat

func TextFormat(colors bool) loggerOpt

Types

type FileProperties

type FileProperties struct {
	Location string `json:"location" yaml:"location"`
}

type GelfProperties

type GelfProperties struct {
	Address string `json:"address" yaml:"address"`
}

type LoggerProperties

type LoggerProperties struct {
	Output string          `json:"output" yaml:"output"`
	Gelf   *GelfProperties `json:"gelf" yaml:"gelf"`
	File   *FileProperties `json:"file" yaml:"file"`
	Format string          `json:"format" yaml:"format"`
	Text   *TextProperties `json:"text" yaml:"text"`
}

type Properties

type Properties struct {
	Loggers []*LoggerProperties `json:"loggers" yaml:"loggers"`
	Fields  map[string]string   `json:"fields" yaml:"fields"`
	Level   string              `json:"level"  yaml:"level"`
}

type TextProperties

type TextProperties struct {
	Colors bool `json:"colors" yaml:"colors"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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