Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetupDefaultLogger ¶ added in v1.1.0
func SetupDefaultLogger(cfg *Config, m ...slogmulti.Middleware) error
SetupDefaultLogger initializes slog.Default() from an explicit configuration. Import handler packages (e.g. stderr, otel, datadog) via blank imports to register them.
Types ¶
type Config ¶
type Config struct {
Outputs []string `env:"_OUTPUTS" envDefault:"stderr:json"`
Level slog.Level `env:"_LEVEL" envDefault:"INFO"`
Caller bool `env:"_CALLER" envDefault:"true"`
ErrorFormatting bool `env:"_ERROR_FORMATTING" envDefault:"false"`
}
Config holds logging configuration parsed from environment variables.
func GetConfigFromEnv ¶
GetConfigFromEnv reads logging configuration from environment variables.
func (*Config) GetHandler ¶
GetHandler builds a composite slog.Handler from the configured outputs and middlewares.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package all imports every in-tree fastlog handler so each handler registers with the default fastlog handler registry through its init hook.
|
Package all imports every in-tree fastlog handler so each handler registers with the default fastlog handler registry through its init hook. |
Click to show internal directories.
Click to hide internal directories.