src/debugAdapter: add more logging for tasks running without debugging

This allows to inspect exactly what command is run.
Similar logging is already in place for tasks running with debugging
(i.e. delve).

Updates microsoft/vscode-go#3034

Change-Id: I76fbd9bcf3571d6c8e11c510b11a067113e46c98

Change-Id: I76fbd9bcf3571d6c8e11c510b11a067113e46c98
GitHub-Last-Rev: 200f58261fcdf379cbf5cc232822f93538e8932c
GitHub-Pull-Request: golang/vscode-go#173
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/236537
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
diff --git a/src/debugAdapter/goDebug.ts b/src/debugAdapter/goDebug.ts
index 099f6a7..68b3257 100644
--- a/src/debugAdapter/goDebug.ts
+++ b/src/debugAdapter/goDebug.ts
@@ -387,6 +387,7 @@
 			};
 
 			if (mode === 'remote') {
+				log(`Start remote debugging: connecting ${launchArgs.host}:${launchArgs.port}`);
 				this.debugProcess = null;
 				this.isRemoteDebugging = true;
 				serverRunning = true; // assume server is running when in remote mode
@@ -445,6 +446,7 @@
 				}
 				this.dlvEnv = env;
 				log(`Using GOPATH: ${env['GOPATH']}`);
+				log(`Using GOROOT: ${env['GOROOT']}`);
 
 				if (!!launchArgs.noDebug) {
 					if (mode === 'debug') {
@@ -463,7 +465,11 @@
 							runArgs.push(...launchArgs.args);
 						}
 
-						this.debugProcess = spawn(getBinPathWithPreferredGopath('go', []), runArgs, runOptions);
+						const goExe = getBinPathWithPreferredGopath('go', []);
+						log(`Current working directory: ${dirname}`);
+						log(`Running: ${goExe} ${runArgs.join(' ')}`);
+
+						this.debugProcess = spawn(goExe, runArgs, runOptions);
 						this.debugProcess.stderr.on('data', (chunk) => {
 							const str = chunk.toString();
 							if (this.onstderr) {