Skip to content

Commit

Permalink
remove unnecessary nil checks (#701)
Browse files Browse the repository at this point in the history
Co-authored-by: Abdullah Alaadine <abdullah.aladdine@montymobile.com>
  • Loading branch information
knbr13 and Abdullah Alaadine authored Dec 27, 2024
1 parent 582f820 commit 31e7995
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion console.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ func (w ConsoleWriter) writeFields(evt map[string]interface{}, buf *bytes.Buffer
func (w ConsoleWriter) writePart(buf *bytes.Buffer, evt map[string]interface{}, p string) {
var f Formatter

if w.PartsExclude != nil && len(w.PartsExclude) > 0 {
if len(w.PartsExclude) > 0 {
for _, exclude := range w.PartsExclude {
if exclude == p {
return
Expand Down
2 changes: 1 addition & 1 deletion log.go
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ func (l *Logger) newEvent(level Level, done func(string)) *Event {
if level != NoLevel && LevelFieldName != "" {
e.Str(LevelFieldName, LevelFieldMarshalFunc(level))
}
if l.context != nil && len(l.context) > 1 {
if len(l.context) > 1 {
e.buf = enc.AppendObjectData(e.buf, l.context)
}
if l.stack {
Expand Down

0 comments on commit 31e7995

Please sign in to comment.