Skip to content

Commit 7793495

Browse files
committed
chore(protonvpn): add debug logs for keeping port forwarded
1 parent 9b00763 commit 7793495

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

internal/portforward/service/interfaces.go

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ type Routing interface {
1717
}
1818

1919
type Logger interface {
20+
Debug(s string)
2021
Info(s string)
2122
Warn(s string)
2223
Error(s string)

internal/provider/protonvpn/portforward.go

+3
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ func (p *Provider) KeepPortForward(ctx context.Context,
8585
case <-timer.C:
8686
}
8787

88+
objects.Logger.Debug("refreshing port forward since 45 seconds have elapsed")
8889
networkProtocols := []string{"udp", "tcp"}
8990
const internalPort = 0
9091
const lifetime = 60 * time.Second
@@ -109,6 +110,8 @@ func (p *Provider) KeepPortForward(ctx context.Context,
109110
}
110111
}
111112

113+
objects.Logger.Debug(fmt.Sprintf("port forwarded %d maintained", p.portForwarded))
114+
112115
timer.Reset(refreshTimeout)
113116
}
114117
}

internal/provider/utils/logger.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package utils
22

33
type Logger interface {
4+
Debug(s string)
45
Info(s string)
56
Warn(s string)
67
Error(s string)

0 commit comments

Comments
 (0)