chore(protonvpn): add debug logs for keeping port forwarded

This commit is contained in:
Quentin McGaw
2023-09-26 13:48:45 +00:00
parent 9b00763a69
commit a194906bdd
4 changed files with 6 additions and 0 deletions

View File

@@ -21,6 +21,7 @@ type PortAllower interface {
} }
type Logger interface { type Logger interface {
Debug(s string)
Info(s string) Info(s string)
Warn(s string) Warn(s string)
Error(s string) Error(s string)

View File

@@ -17,6 +17,7 @@ type Routing interface {
} }
type Logger interface { type Logger interface {
Debug(s string)
Info(s string) Info(s string)
Warn(s string) Warn(s string)
Error(s string) Error(s string)

View File

@@ -85,6 +85,7 @@ func (p *Provider) KeepPortForward(ctx context.Context,
case <-timer.C: case <-timer.C:
} }
objects.Logger.Debug("refreshing port forward since 45 seconds have elapsed")
networkProtocols := []string{"udp", "tcp"} networkProtocols := []string{"udp", "tcp"}
const internalPort = 0 const internalPort = 0
const lifetime = 60 * time.Second const lifetime = 60 * time.Second
@@ -109,6 +110,8 @@ func (p *Provider) KeepPortForward(ctx context.Context,
} }
} }
objects.Logger.Debug(fmt.Sprintf("port forwarded %d maintained", p.portForwarded))
timer.Reset(refreshTimeout) timer.Reset(refreshTimeout)
} }
} }

View File

@@ -1,6 +1,7 @@
package utils package utils
type Logger interface { type Logger interface {
Debug(s string)
Info(s string) Info(s string)
Warn(s string) Warn(s string)
Error(s string) Error(s string)