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 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 ¶
Click to show internal directories.
Click to hide internal directories.