Skip to content

Commit 7019984

Browse files
committed
Change "Not forwarding" messages to debug level
Info level should be used only for important events or changes to the system, for example when we forward a port from the guest. Not forwarding a port can be helpful when debugging port forwarding, so keeping it as debug message. Part-of: lima-vm#2577 Signed-off-by: Nir Soffer <[email protected]>
1 parent 52f5ad3 commit 7019984

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

hack/test-port-forwarding.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# running to perform the tests:
77
#
88
# ./hack/test-port-forwarding.pl templates/default.yaml
9-
# limactl --tty=false start templates/default.yaml
9+
# limactl --tty=false --log-level debug start templates/default.yaml
1010
# git restore templates/default.yaml
1111
# ./hack/test-port-forwarding.pl default
1212
#

pkg/hostagent/port.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ func (pf *portForwarder) OnEvent(ctx context.Context, ev *api.Event) {
9494
}
9595
local, remote := pf.forwardingAddresses(f)
9696
if local == "" {
97-
logrus.Infof("Not forwarding TCP %s", remote)
97+
logrus.Debugf("Not forwarding TCP %s", remote)
9898
continue
9999
}
100100
logrus.Infof("Forwarding TCP from %s to %s", remote, local)

pkg/portfwd/forward.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func (fw *Forwarder) OnEvent(ctx context.Context, client *guestagentclient.Guest
2626
for _, f := range ev.LocalPortsAdded {
2727
local, remote := fw.forwardingAddresses(f)
2828
if local == "" {
29-
logrus.Infof("Not forwarding %s %s", strings.ToUpper(f.Protocol), remote)
29+
logrus.Debugf("Not forwarding %s %s", strings.ToUpper(f.Protocol), remote)
3030
continue
3131
}
3232
logrus.Infof("Forwarding %s from %s to %s", strings.ToUpper(f.Protocol), remote, local)

0 commit comments

Comments
 (0)