1
0
mirror of https://github.com/rs/zerolog synced 2026-06-08 17:13:30 +00:00

remove unnecessary nil checks (#701)

Co-authored-by: Abdullah Alaadine <abdullah.aladdine@montymobile.com>
This commit is contained in:
Abdullah Alaadine
2024-12-27 04:41:46 +02:00
committed by GitHub
parent 582f820cf0
commit 31e7995c5b
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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 {