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

Let WithoutPadding returns a new entry #7

Merged
merged 1 commit into from Dec 14, 2022
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
9 changes: 6 additions & 3 deletions entry.go
Expand Up @@ -80,10 +80,13 @@ func (e *Entry) WithError(err error) *Entry {
return ctx
}

// WithoutPadding returns entry without padding set to false.
// WithoutPadding returns a new entry with padding set to default.
func (e *Entry) WithoutPadding() *Entry {
e.Padding = defaultPadding
return e
return &Entry{
Logger: e.Logger,
Padding: defaultPadding,
fields: e.fields,
}
}

// Debug level message.
Expand Down
2 changes: 1 addition & 1 deletion logger.go
Expand Up @@ -131,7 +131,7 @@ func (l *Logger) WithError(err error) *Entry {
return NewEntry(l).WithError(err)
}

// WithoutPadding returns a new entry without padding.
// WithoutPadding returns a new entry with padding set to default.
func (l *Logger) WithoutPadding() *Entry {
return NewEntry(l).WithoutPadding()
}
Expand Down
2 changes: 1 addition & 1 deletion pkg.go
Expand Up @@ -61,7 +61,7 @@ func WithError(err error) *Entry {
return Log.WithError(err)
}

// WithoutPadding returns a new entry without padding.
// WithoutPadding returns a new entry with padding set to default.
func WithoutPadding() *Entry {
return Log.WithoutPadding()
}
Expand Down