Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TestLogger ¶
Types ¶
type Config ¶
type Config struct {
Fields map[string]any `json:"fields" yaml:"fields" toml:"fields"`
Sinks []SinkConfig `json:"sinks" yaml:"sinks" toml:"sinks"`
}
type FormatType ¶
type FormatType string
const ( FormatText FormatType = "text" FormatPretty FormatType = "pretty" FormatJSON FormatType = "json" )
type PrettyTextHandler ¶
type PrettyTextHandler struct {
// contains filtered or unexported fields
}
func NewPrettyTextHandler ¶
func NewPrettyTextHandler(w io.Writer, opts *slog.HandlerOptions) *PrettyTextHandler
func NewPrettyTextHandlerWithOptions ¶
func NewPrettyTextHandlerWithOptions(w io.Writer, opts *PrettyTextHandlerOptions) *PrettyTextHandler
type PrettyTextHandlerOptions ¶
type PrettyTextHandlerOptions struct {
HandlerOptions *slog.HandlerOptions
SourceCut string
}
type RotationConfig ¶
type RotationConfig struct {
Enabled bool `toml:"enabled" json:"enabled"`
MaxSizeMB int `toml:"max_size_mb" json:"max_size_mb"`
MaxBackups int `toml:"max_backups" json:"max_backups"`
MaxAgeDays int `toml:"max_age_days" json:"max_age_days"`
Compress bool `toml:"compress" json:"compress"`
LocalTime bool `toml:"local_time" json:"local_time"`
}
type SinkConfig ¶
type SinkConfig struct {
Type SinkType `json:"type" yaml:"type" toml:"type"`
Format FormatType `json:"format" yaml:"format" toml:"format"`
Level string `json:"level" yaml:"level" toml:"level"`
AddSource bool `json:"add_source" yaml:"add_source" toml:"add_source"`
Filepath string `json:"filepath" yaml:"filepath" toml:"filepath"`
Rotation *RotationConfig `json:"rotation" yaml:"rotation" toml:"rotation"`
}
Click to show internal directories.
Click to hide internal directories.