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:
parent
0c507cd5ed
commit
75dae46700
1 changed files with 3 additions and 2 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue