Separate formatters in config

This commit is contained in:
Dan Jones 2024-03-07 21:19:45 -06:00
commit da3b524925
6 changed files with 56 additions and 11 deletions

View file

@ -1,8 +1,9 @@
package config
type Config struct {
Input Input
Outputs Outputs `toml:"output"`
Input Input
Outputs Outputs `toml:"output"`
Formatters Formatters
}
type Input struct {
@ -20,9 +21,15 @@ type Output struct {
}
type Stdout struct {
Json bool `env:"LOG_STDOUT_JSON" mapstructure:"json"`
Formatter string `env:"LOG_STDOUT_FORMATTER" mapstructure:"formatter"`
}
type stdoutEnabled struct {
Enabled bool `env:"LOG_STDOUT_ENABLED"`
}
type Formatters map[string]map[string]any
type JsonFormat struct {
PrettyPrint bool `env:"LOG_JSON_PRETTY_PRINT" mapstructure:"pretty_print"`
}