From d0f68c5d1a0c0e7a3b0387c90fa326bb749462e1 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Mon, 23 Feb 2015 02:44:09 +0000 Subject: [PATCH] Make CGI do errors better --- spongy.cgi/spongy.cgi.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spongy.cgi/spongy.cgi.go b/spongy.cgi/spongy.cgi.go index 580a51e..4b36e75 100644 --- a/spongy.cgi/spongy.cgi.go +++ b/spongy.cgi/spongy.cgi.go @@ -161,6 +161,9 @@ func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { } func main() { + log.SetOutput(os.Stdout) + log.SetFlags(0) + log.SetPrefix("Status: 500 CGI Go Boom\nContent-type: text/plain\n\nERROR: ") h := Handler{} if err := cgi.Serve(h); err != nil { log.Fatal(err)