Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing newline in IncreaseLevel error messages #828

Merged
merged 3 commits into from May 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion increase_level_test.go
Expand Up @@ -58,7 +58,7 @@ func TestIncreaseLevelTryDecrease(t *testing.T) {
newLoggedEntry(ErrorLevel, "increase level error log"),
}, logs.AllUntimed(), "unexpected logs")
assert.Equal(t,
`failed to IncreaseLevel: invalid increase level, as level "info" is allowed by increased level, but not by existing core`,
"failed to IncreaseLevel: invalid increase level, as level \"info\" is allowed by increased level, but not by existing core\n",
errorOut.String(),
"unexpected error output",
)
Expand Down
2 changes: 1 addition & 1 deletion options.go
Expand Up @@ -125,7 +125,7 @@ func IncreaseLevel(lvl zapcore.LevelEnabler) Option {
return optionFunc(func(log *Logger) {
core, err := zapcore.NewIncreaseLevelCore(log.core, lvl)
if err != nil {
fmt.Fprintf(log.errorOutput, "failed to IncreaseLevel: %v", err)
fmt.Fprintf(log.errorOutput, "failed to IncreaseLevel: %v\n", err)
} else {
log.core = core
}
Expand Down