1
0
Fork 0
mirror of https://github.com/eosswedenorg/antelope-api-healthcheck synced 2026-06-17 04:50:02 +02:00

server.go: use new log module to log messages.

This commit is contained in:
Henrik Hautakoski 2020-02-07 08:17:55 +01:00
parent 0c507cd5ed
commit 75dae46700

View file

@ -6,6 +6,7 @@ import (
"time"
"strings"
"strconv"
"./log"
"./haproxy"
"./eosapi"
"github.com/firstrow/tcp_server"
@ -151,11 +152,11 @@ func main() {
status, msg = check_api(host, port, float64(block_time))
}
fmt.Printf("[Status %s] %s:%d (%d blocks): %s\n",
log.Info("Status %s - %s:%d (%d blocks): %s",
version, host, port, block_time / 2, status)
if status != haproxy.HealthCheckUp && len(msg) > 0 {
fmt.Println(msg)
log.Warning(msg)
}
// Report status to HAproxy