From efb2d846c3204ebf6c4476b6bff8b5bb26ecc9c8 Mon Sep 17 00:00:00 2001 From: "Stephen McQuay (smcquay)" Date: Wed, 7 Feb 2018 15:17:58 -0800 Subject: [PATCH] Adds logging --- main.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index f4098a8..802fe08 100644 --- a/main.go +++ b/main.go @@ -8,7 +8,7 @@ import ( "os" ) -const version = "v0.0.9" +const version = "v0.0.10" type v struct { Hostname string `json:"hostname"` @@ -35,11 +35,13 @@ func main() { fmt.Fprintf(w, "%v\n", line) } }) - http.HandleFunc("/live", health) - http.HandleFunc("/ready", health) + http.HandleFunc("/live", func(w http.ResponseWriter, req *http.Request) { + log.Printf("live") + }) + http.HandleFunc("/ready", func(w http.ResponseWriter, req *http.Request) { + log.Printf("ready") + }) if err := http.ListenAndServe(":8080", nil); err != nil { log.Fatalf("listen and serve: %v", err) } } - -func health(w http.ResponseWriter, req *http.Request) {}