From 3ef01c6291b5585a44ecd92c55977b96932f5056 Mon Sep 17 00:00:00 2001 From: Simon Eskildsen Date: Mon, 3 Mar 2014 17:35:32 -0500 Subject: [PATCH] entry: don't panic --- entry.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/entry.go b/entry.go index da02aec..b326889 100644 --- a/entry.go +++ b/entry.go @@ -82,8 +82,7 @@ func (entry *Entry) log(level string, msg string) string { reader, err := entry.Reader() if err != nil { - // TODO: Panic? - entry.logger.Panicf("Failed to obtain reader, %v", err) + fmt.Fprintf(os.Stderr, "Failed to obtain reader, %v", err) } // Send HTTP request in a goroutine in warning environment to not halt the @@ -101,9 +100,8 @@ func (entry *Entry) log(level string, msg string) string { defer entry.logger.mu.Unlock() _, err = io.Copy(entry.logger.Out, reader) - // TODO: Panic? if err != nil { - entry.logger.Panicln("Failed to log message, %v", err) + fmt.Fprintf(os.Stderr, "Failed to obtain reader, %v", err) } return reader.String()