Skip to content

Commit c7ed650

Browse files
committed
Address review comments.
1 parent e66aaf0 commit c7ed650

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

src/client/debugger/extension/adapter/logging.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@ import { StopWatch } from '../../../common/utils/stopWatch';
1313
import { EXTENSION_ROOT_DIR } from '../../../constants';
1414

1515
class DebugSessionLoggingTracker implements DebugAdapterTracker {
16-
private readonly session: DebugSession;
1716
private readonly enabled: boolean = false;
1817
private stream: fs.WriteStream | undefined;
1918
private timer = new StopWatch();
2019

21-
constructor(session: DebugSession, fileSystem: IFileSystem) {
20+
constructor(private readonly session: DebugSession, fileSystem: IFileSystem) {
2221
this.session = session;
2322
this.enabled = this.session.configuration.logToFile as boolean;
2423
if (this.enabled) {
@@ -33,15 +32,15 @@ class DebugSessionLoggingTracker implements DebugAdapterTracker {
3332
}
3433

3534
public onWillReceiveMessage(message: DebugProtocol.Message) {
36-
this.log(`Client <-- Adapter:\n${this.stringify(message)}\n`);
35+
this.log(`Client --> Adapter:\n${this.stringify(message)}\n`);
3736
}
3837

3938
public onDidSendMessage(message: DebugProtocol.Message) {
40-
this.log(`Client --> Adapter:\n${this.stringify(message)}\n`);
39+
this.log(`Client <-- Adapter:\n${this.stringify(message)}\n`);
4140
}
4241

4342
public onWillStopSession() {
44-
this.log(`Stopping Session\n`);
43+
this.log('Stopping Session\n');
4544
}
4645

4746
public onError(error: Error) {
@@ -65,10 +64,7 @@ class DebugSessionLoggingTracker implements DebugAdapterTracker {
6564

6665
@injectable()
6766
export class DebugSessionLoggingFactory implements DebugAdapterTrackerFactory {
68-
constructor(
69-
@inject(IFileSystem) private readonly fileSystem: IFileSystem
70-
) {
71-
}
67+
constructor(@inject(IFileSystem) private readonly fileSystem: IFileSystem) { }
7268

7369
public createDebugAdapterTracker(session: DebugSession): ProviderResult<DebugAdapterTracker> {
7470
return new DebugSessionLoggingTracker(session, this.fileSystem);

src/test/debugger/extension/adapter/logging.unit.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ suite('Debugging - Session Logging', () => {
6363
public type: string;
6464
public id: number;
6565
public format: string;
66-
public variables?: { [key: string]: string } | undefined;
67-
public sendTelemetry?: boolean | undefined;
68-
public showUser?: boolean | undefined;
69-
public url?: string | undefined;
70-
public urlLabel?: string | undefined;
66+
public variables?: { [key: string]: string };
67+
public sendTelemetry?: boolean;
68+
public showUser?: boolean;
69+
public url?: string;
70+
public urlLabel?: string;
7171
constructor(id: number, seq: number, type: string) {
7272
this.id = id;
7373
this.format = 'json';

0 commit comments

Comments
 (0)