summaryrefslogtreecommitdiff
path: root/src/helsinki.at/rhrdtime/rhrdtime.go
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2015-07-18 03:26:20 (GMT)
committerChristian Pointner <equinox@helsinki.at>2015-07-18 03:28:41 (GMT)
commit275a187cfb8646f9c11ecc4bd228b411074161dc (patch)
tree50e8bb3e8085734ca0dfe88a9855f2956063bb8f /src/helsinki.at/rhrdtime/rhrdtime.go
parent84c13cf4a1864457608eb24061b07597be060546 (diff)
improved log output
Diffstat (limited to 'src/helsinki.at/rhrdtime/rhrdtime.go')
-rw-r--r--src/helsinki.at/rhrdtime/rhrdtime.go7
1 files changed, 4 insertions, 3 deletions
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
}
}