Documentation ¶
Index ¶
- Variables
- func ApplyLoggerProperties(properties *LoggerProperties) loggerOpt
- func ApplyProperties(properties *Properties) loggingOpt
- func Configure(opts ...loggingOpt)
- func Field(name, value string) loggingOpt
- func Fields(fields map[string]string) loggingOpt
- func FileOutput(location string) loggerOpt
- func GelfOutput(protocol, address, tag string) loggerOpt
- func Level(level string) loggingOpt
- func Logger(opts ...loggerOpt) *logger
- func Loggers(loggers ...*logger) loggingOpt
- func TextFormat(colors bool) loggerOpt
- type FileProperties
- type GelfProperties
- type LoggerProperties
- type Properties
- type TextProperties
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 FileOutput ¶
func FileOutput(location string) loggerOpt
func GelfOutput ¶
func GelfOutput(protocol, address, tag string) loggerOpt
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"`
}
Click to show internal directories.
Click to hide internal directories.