Skip to content

Commit

Permalink
chore(protonvpn): add debug logs for keeping port forwarded
Browse files Browse the repository at this point in the history
  • Loading branch information
qdm12 committed Sep 28, 2023
1 parent 9b00763 commit 7793495
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/portforward/service/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ type Routing interface {
}

type Logger interface {
Debug(s string)
Info(s string)
Warn(s string)
Error(s string)
Expand Down
3 changes: 3 additions & 0 deletions internal/provider/protonvpn/portforward.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ func (p *Provider) KeepPortForward(ctx context.Context,
case <-timer.C:
}

objects.Logger.Debug("refreshing port forward since 45 seconds have elapsed")
networkProtocols := []string{"udp", "tcp"}
const internalPort = 0
const lifetime = 60 * time.Second
Expand All @@ -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)
}
}
1 change: 1 addition & 0 deletions internal/provider/utils/logger.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package utils

type Logger interface {
Debug(s string)
Info(s string)
Warn(s string)
Error(s string)
Expand Down

0 comments on commit 7793495

Please sign in to comment.