Skip to content

Commit 274bc43

Browse files
authored
Merge pull request #767 from aluedeke/fix/forward-connect-log-level
fix(forward): quiet per-connection logs and return the real connect error
2 parents bd51cfb + 1d88f04 commit 274bc43

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

ios/forward/forward.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func connectionAccept(cl *ConnListener, deviceID int, phonePort uint16) {
7979
golog.Error("error accepting new connection", "module", logModule, "deviceID", deviceID, "phonePort", phonePort, "error", err)
8080
continue
8181
}
82-
golog.Info("new client connected", "module", logModule, "deviceID", deviceID, "phonePort", phonePort, "conn", fmt.Sprintf("%#v", cl))
82+
golog.Debug("new client connected", "module", logModule, "deviceID", deviceID, "phonePort", phonePort, "conn", fmt.Sprintf("%#v", cl))
8383
go StartNewProxyConnection(context.TODO(), clientConn, deviceID, phonePort)
8484
}
8585
}
@@ -94,11 +94,11 @@ func StartNewProxyConnection(ctx context.Context, clientConn io.ReadWriteCloser,
9494
}
9595
muxError := usbmuxConn.Connect(deviceID, phonePort)
9696
if muxError != nil {
97-
golog.Info("could not connect to phone", "module", logModule, "deviceID", deviceID, "conn", fmt.Sprintf("%#v", clientConn), "error", muxError, "phonePort", phonePort)
97+
golog.Debug("could not connect to phone", "module", logModule, "deviceID", deviceID, "conn", fmt.Sprintf("%#v", clientConn), "error", muxError, "phonePort", phonePort)
9898
clientConn.Close()
99-
return fmt.Errorf("could not connect to port:%d on iOS: %v", phonePort, err)
99+
return fmt.Errorf("could not connect to port:%d on iOS: %v", phonePort, muxError)
100100
}
101-
golog.Info("connected to port", "module", logModule, "deviceID", deviceID, "conn", fmt.Sprintf("%#v", clientConn), "phonePort", phonePort)
101+
golog.Debug("connected to port", "module", logModule, "deviceID", deviceID, "conn", fmt.Sprintf("%#v", clientConn), "phonePort", phonePort)
102102
deviceConn := usbmuxConn.ReleaseDeviceConnection()
103103

104104
proxyConns(ctx, clientConn, deviceConn, deviceID, phonePort)

0 commit comments

Comments
 (0)