Skip to content

Commit 68ebe37

Browse files
committed
Log more detailed info
1 parent 6d690fe commit 68ebe37

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/debug-adapter/webKitDebugAdapter.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class WebKitDebugAdapter implements DebugProtocol.IDebugAdapter {
4040
private _webKitConnection: INSDebugConnection;
4141
private _eventHandler: (event: DebugProtocol.Event) => void;
4242
private _lastOutputEvent: OutputEvent;
43-
private _loggerFrontendHandler: LoggerHandler = args => this.fireEvent(new OutputEvent(`${args.message}\n`, args.type.toString()));
43+
private _loggerFrontendHandler: LoggerHandler = args => this.fireEvent(new OutputEvent(`${args.message}\n`, args.type.toString()));
4444
private _request: DebugRequest;
4545

4646
public constructor() {
@@ -142,6 +142,8 @@ export class WebKitDebugAdapter implements DebugProtocol.IDebugAdapter {
142142
Services.extensionClient().analyticsLaunchDebugger({ request: this._request.isSync ? "sync" : args.request, platform: args.platform });
143143

144144
// Run CLI Command
145+
Services.logger().log(`[NSDebugAdapter] Using tns CLI on path '${this._request.project.cli.path}'`, Tags.FrontendMessage);
146+
Services.logger().log('[NSDebugAdapter] Running tns command...', Tags.FrontendMessage);
145147
let cliCommand: DebugResult;
146148
if (this._request.isLaunch) {
147149
cliCommand = this._request.project.debug({ stopOnEntry: this._request.launchArgs.stopOnEntry }, this._request.args.tnsArgs);
@@ -161,14 +163,16 @@ export class WebKitDebugAdapter implements DebugProtocol.IDebugAdapter {
161163

162164
let promiseResolve = null;
163165
let promise: Promise<void> = new Promise<void>((res, rej) => { promiseResolve = res; });
166+
Services.logger().log('[NSDebugAdapter] Watching the tns CLI output to receive a connection token', Tags.FrontendMessage);
164167
// Attach to the running application
165168
cliCommand.tnsOutputEventEmitter.on('readyForConnection', (connectionToken: string | number) => {
166169
connectionToken = this._request.isAndroid ? this._request.androidProject.getDebugPortSync() : connectionToken;
167-
Services.logger().log(`Attaching to application on ${connectionToken}`);
170+
Services.logger().log(`[NSDebugAdapter] Attaching to application on ${connectionToken}`, Tags.FrontendMessage);
168171
let connection: INSDebugConnection = this._request.isAndroid ? new AndroidConnection() : new IosConnection();
169172
this.setConnection(connection);
170173
let attachPromise = this._request.isAndroid ? (<AndroidConnection>connection).attach(<number>connectionToken, 'localhost') : (<IosConnection>connection).attach(<string>connectionToken);
171174
attachPromise.then(() => {
175+
Services.logger().log(`[NSDebugAdapter] Successfully attached to the target application'`, Tags.FrontendMessage);
172176
// Send InitializedEvent
173177
this.fireEvent(new InitializedEvent());
174178
promiseResolve();

src/project/nativeScriptCli.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {spawn, execSync, ChildProcess} from 'child_process';
22
import {Version} from '../common/version';
3-
import {Logger} from '../common/logger';
3+
import {Logger, Tags} from '../common/logger';
44
import * as utils from '../common/utilities';
55

66
export enum CliVersionState {
@@ -67,13 +67,13 @@ export class NativeScriptCli {
6767

6868
public executeSync(args: string[], cwd: string): string {
6969
let command: string = `${this._path} ` + args.join(' ');
70-
this._logger.log(`[NativeScriptCli] execute sync: ${command}`);
70+
this._logger.log(`[NativeScriptCli] execute: ${command}`, Tags.FrontendMessage);
7171
return execSync(command, { encoding: "utf8", cwd: cwd }).toString().trim();
7272
}
7373

7474
public execute(args: string[], cwd: string): ChildProcess {
7575
let command: string = `${this._path} ` + args.join(' ');
76-
this._logger.log(`[NativeScriptCli] execute async: ${command}`);
76+
this._logger.log(`[NativeScriptCli] execute: ${command}`, Tags.FrontendMessage);
7777

7878
let options = { cwd: cwd, shell: true };
7979
let child: ChildProcess = spawn(this._path, args, options);

0 commit comments

Comments
 (0)