1
0
Fork 0
mirror of https://github.com/eosswedenorg/antelope-api-healthcheck synced 2026-06-20 09:56:49 +02:00

replace standard logger for github.com/inconshreveable/log15

This commit is contained in:
Henrik Hautakoski 2022-01-03 17:34:02 +01:00
parent 107df930f1
commit 1d8b47762e
No known key found for this signature in database
GPG key ID: 608414D93E862CCD
8 changed files with 38 additions and 137 deletions

View file

@ -5,7 +5,6 @@ import (
"time"
"strings"
"strconv"
"internal/log"
"internal/eosapi"
"internal/utils"
"github.com/eosswedenorg-go/haproxy"
@ -136,11 +135,11 @@ func onTcpMessage(c *tcp_server.Client, args string) {
status, msg = check_api(params, float64(block_time))
}
log.Info("Status %s - %s (%d blocks): %s",
version, params.Url, block_time / 2, status)
logger.Info("API Check", "version", version, "url", params.Url,
"block", block_time / 2, "status", status)
if status != haproxy.HealthCheckUp && len(msg) > 0 {
log.Warning(msg)
logger.Warn("API Check Failed", "message", msg)
}
// Report status to HAproxy
@ -152,7 +151,6 @@ func onTcpMessage(c *tcp_server.Client, args string) {
// ---------------------------------------------------------
func spawnTcpServer(addr string) {
server := tcp_server.New(addr)
server.OnMessage(onTcpMessage)
server.Listen()