From 275a187cfb8646f9c11ecc4bd228b411074161dc Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 18 Jul 2015 05:26:20 +0200 Subject: improved log output diff --git a/src/helsinki.at/rhrdtime/rhrdtime.go b/src/helsinki.at/rhrdtime/rhrdtime.go index 3501942..519d465 100644 --- a/src/helsinki.at/rhrdtime/rhrdtime.go +++ b/src/helsinki.at/rhrdtime/rhrdtime.go @@ -56,7 +56,7 @@ func getRDWeekAndOffset(t time.Time) (uint8, int) { loc, err := time.LoadLocation("Europe/Vienna") if err != nil { - fmt.Println(err) + fmt.Println("Error while loading loaction Europe/Vienna:", err) return 0, 0 } @@ -98,7 +98,7 @@ func handleNTPClient(w http.ResponseWriter, r *http.Request) { var n ntpMessage if err := json.Unmarshal(msg, &n); err != nil { - fmt.Println("ignoring mallformed (", err, ") NTP message from:", ws.RemoteAddr()) + fmt.Println("Ignoring malformed (", err, ") NTP message from:", ws.RemoteAddr()) continue } @@ -110,10 +110,11 @@ func handleNTPClient(w http.ResponseWriter, r *http.Request) { ntp_json, err := json.Marshal(n) if err != nil { - fmt.Println(err) + fmt.Println("Error while encoding to json:", err) continue } if err := ws.WriteMessage(websocket.TextMessage, ntp_json); err != nil { + fmt.Println("Client", ws.RemoteAddr(), "write error:", err) return } } -- cgit v0.10.2