Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigureTargets ¶
ConfigureTargets replaces the current list of log targets with a new one based on a map of name->TargetCfg. The map of TargetCfg's would typically be serialized from a JSON source or can be programmatically created.
An optional set of factories can be provided which will be called to create any target types or formatters not built-in.
To append log targets to an existing config, use `(*Logr).AddTarget` or `(*Logr).AddTargetFromConfig` instead.
Types ¶
type ConsoleOptions ¶
type ConsoleOptions struct {
Out string `json:"out"` // one of "stdout", "stderr"
}
type Factories ¶
type Factories struct { TargetFactory TargetFactory // can be nil FormatterFactory FormatterFactory // can be nil }
type FormatterFactory ¶
type FormatterFactory func(format string, options json.RawMessage) (logr.Formatter, error)
type TargetCfg ¶
type TargetCfg struct { Type string `json:"type"` // one of "console", "file", "tcp", "syslog", "none". Options json.RawMessage `json:"options,omitempty"` Format string `json:"format"` // one of "json", "plain", "gelf" FormatOptions json.RawMessage `json:"format_options,omitempty"` Levels []logr.Level `json:"levels"` MaxQueueSize int `json:"maxqueuesize,omitempty"` }
type TargetFactory ¶
type TargetFactory func(targetType string, options json.RawMessage) (logr.Target, error)
Click to show internal directories.
Click to hide internal directories.