mirror of https://github.com/sirupsen/logrus.git
entry: add comment to panic comparison in log()
This commit is contained in:
parent
51ca046ebf
commit
3b5af9a6dc
3
entry.go
3
entry.go
|
@ -92,6 +92,9 @@ func (entry *Entry) log(level Level, msg string) {
|
||||||
fmt.Fprintf(os.Stderr, "Failed to write to log, %v\n", err)
|
fmt.Fprintf(os.Stderr, "Failed to write to log, %v\n", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// To avoid Entry#log() returning a value that only would make sense for
|
||||||
|
// panic() to use in Entry#Panic(), we avoid the allocation by checking
|
||||||
|
// directly here.
|
||||||
if level <= PanicLevel {
|
if level <= PanicLevel {
|
||||||
panic(reader.String())
|
panic(reader.String())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue