🚚 Rename stdout.config.formatter to format
This commit is contained in:
parent
d6482952a4
commit
8086029b03
6 changed files with 8 additions and 9 deletions
|
|
@ -28,7 +28,7 @@ dotFolder = true
|
|||
enabled = true
|
||||
[output.stdout.config]
|
||||
# Formatter to use when outputting to stdout
|
||||
formatter = "plain"
|
||||
format = "plain"
|
||||
|
||||
[formatters]
|
||||
|
||||
|
|
|
|||
|
|
@ -70,14 +70,14 @@ func TestStdoutMissing(t *testing.T) {
|
|||
}
|
||||
|
||||
func TestStdoutLoad(t *testing.T) {
|
||||
os.Setenv("LOG_STDOUT_FORMATTER", "json")
|
||||
defer os.Unsetenv("LOG_STDOUT_FORMATTER")
|
||||
os.Setenv("LOG_STDOUT_FORMAT", "json")
|
||||
defer os.Unsetenv("LOG_STDOUT_FORMAT")
|
||||
os.Setenv("LOG_STDOUT_ENABLED", "true")
|
||||
defer os.Unsetenv("LOG_STDOUT_ENABLED")
|
||||
c, _ := Load()
|
||||
std, en := c.Outputs.Stdout()
|
||||
assert.True(t, en)
|
||||
assert.Equal(t, "json", std.Formatter)
|
||||
assert.Equal(t, "json", std.Format)
|
||||
}
|
||||
|
||||
func TestFormatJson(t *testing.T) {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ type Output struct {
|
|||
}
|
||||
|
||||
type Stdout struct {
|
||||
Formatter string `env:"LOG_STDOUT_FORMATTER" mapstructure:"formatter"`
|
||||
Format string `env:"LOG_STDOUT_FORMAT" mapstructure:"format"`
|
||||
}
|
||||
|
||||
type stdoutEnabled struct {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue