Skip to content

Commit

Permalink
fix: WithoutPadding returns a new entry (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
nervo committed Dec 14, 2022
1 parent b065845 commit 6754d38
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
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

0 comments on commit 6754d38

Please sign in to comment.