From 3b5af9a6dcdae3bfc5ec34947e4023514f75ea9a Mon Sep 17 00:00:00 2001 From: Simon Eskildsen Date: Thu, 25 Sep 2014 03:08:26 +0000 Subject: [PATCH] entry: add comment to panic comparison in log() --- entry.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/entry.go b/entry.go index 433b71e..dc2b0a7 100644 --- a/entry.go +++ b/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) } + // 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 { panic(reader.String()) }