forked from mirror/logrus
return early
This makes it easier to read / understand and is more idiomatic.
This commit is contained in:
parent
de736cf91b
commit
60320cbc2c
9
entry.go
9
entry.go
|
@ -255,11 +255,10 @@ func (entry *Entry) write() {
|
||||||
serialized, err := entry.Logger.Formatter.Format(entry)
|
serialized, err := entry.Logger.Formatter.Format(entry)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Failed to obtain reader, %v\n", err)
|
fmt.Fprintf(os.Stderr, "Failed to obtain reader, %v\n", err)
|
||||||
} else {
|
return
|
||||||
_, err = entry.Logger.Out.Write(serialized)
|
}
|
||||||
if err != nil {
|
if _, err = entry.Logger.Out.Write(serialized); err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Failed to write to log, %v\n", err)
|
fmt.Fprintf(os.Stderr, "Failed to write to log, %v\n", err)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue