Skip to content

Commit 9f22d98

Browse files
authored
Add some more port forwarding logging (microsoft#165714)
Part of microsoft#165424
1 parent 99a4838 commit 9f22d98

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/vs/workbench/contrib/remote/browser/remoteExplorer.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,13 +558,16 @@ class ProcAutomaticPortForwarding extends Disposable {
558558
for (const value of startingCandidates) {
559559
this.initialCandidates.add(makeAddress(value.host, value.port));
560560
}
561+
this.logService.debug(`ForwardedPorts: (ProcForwarding) Initial candidates set to ${startingCandidates.join(', ')}`);
561562
}
562563

563564
private async forwardCandidates(): Promise<RemoteTunnel[] | undefined> {
564565
let attributes: Map<number, Attributes> | undefined;
565566
const allTunnels: RemoteTunnel[] = [];
567+
this.logService.trace(`ForwardedPorts: (ProcForwarding) Attempting to forward ${this.remoteExplorerService.tunnelModel.candidates.length} candidates`);
566568
for (const value of this.remoteExplorerService.tunnelModel.candidates) {
567569
if (!value.detail) {
570+
this.logService.trace(`ForwardedPorts: (ProcForwarding) Port ${value.port} missing detail`);
568571
continue;
569572
}
570573

@@ -586,18 +589,22 @@ class ProcAutomaticPortForwarding extends Disposable {
586589

587590
const portAttributes = attributes?.get(value.port);
588591
if (portAttributes?.onAutoForward === OnPortForward.Ignore) {
592+
this.logService.trace(`ForwardedPorts: (ProcForwarding) Port ${value.port} is ignored`);
589593
continue;
590594
}
591595
const forwarded = await this.remoteExplorerService.forward({ remote: value, source: AutoTunnelSource }, portAttributes ?? null);
592596
if (!alreadyForwarded && forwarded) {
597+
this.logService.trace(`ForwardedPorts: (ProcForwarding) Port ${value.port} has been forwarded`);
593598
this.autoForwarded.add(address);
594599
} else if (forwarded) {
600+
this.logService.trace(`ForwardedPorts: (ProcForwarding) Port ${value.port} has been notified`);
595601
this.notifiedOnly.add(address);
596602
}
597603
if (forwarded) {
598604
allTunnels.push(forwarded);
599605
}
600606
}
607+
this.logService.trace(`ForwardedPorts: (ProcForwarding) Forwarded ${allTunnels.length} candidates`);
601608
if (allTunnels.length === 0) {
602609
return undefined;
603610
}

0 commit comments

Comments
 (0)