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:
committed by
GitHub
parent
582f820cf0
commit
31e7995c5b
+1
-1
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user