From fc25119a1af9f3301bda886041934c430e084848 Mon Sep 17 00:00:00 2001 From: matst80 Date: Wed, 13 Nov 2024 10:25:08 +0100 Subject: [PATCH] better logs --- tcp-client.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tcp-client.go b/tcp-client.go index 3ef0aad..7ce7163 100644 --- a/tcp-client.go +++ b/tcp-client.go @@ -58,9 +58,10 @@ func (m *PersistentConnection) Connect() error { for { connection, err := net.Dial("tcp", m.address) if err != nil { - log.Printf("Error connecting to %s: %v\n", m.address, err) + log.Printf("Can't connect to %s: %v\n, count: %d", m.address, err, fails) fails++ if fails > 15 { + log.Printf("Too many connection failures, closing connection to %s\n", m.address) m.Died <- true m.Dead = true return err