1
0
Fork 0
mirror of https://github.com/eosswedenorg/antelope-api-healthcheck synced 2026-07-02 11:43:42 +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" "time"
"strings" "strings"
"strconv" "strconv"
"./log"
"./haproxy" "./haproxy"
"./eosapi" "./eosapi"
"github.com/firstrow/tcp_server" "github.com/firstrow/tcp_server"
@ -151,11 +152,11 @@ func main() {
status, msg = check_api(host, port, float64(block_time)) 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) version, host, port, block_time / 2, status)
if status != haproxy.HealthCheckUp && len(msg) > 0 { if status != haproxy.HealthCheckUp && len(msg) > 0 {
fmt.Println(msg) log.Warning(msg)
} }
// Report status to HAproxy // Report status to HAproxy