Skip to content

Commit a8e9982

Browse files
authored
Closes the file stream once the tracker is done (#9818)
Currently the file stream is left opened. This PR closes the log file stream opened for logging purposes. Can file an issue and create a news entry if required. Though I don't see the point.
1 parent 3b90a55 commit a8e9982

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { EXTENSION_ROOT_DIR } from '../../../constants';
1313

1414
class DebugSessionLoggingTracker implements DebugAdapterTracker {
1515
private readonly enabled: boolean = false;
16-
private stream: WriteStream | undefined;
16+
private stream?: WriteStream;
1717
private timer = new StopWatch();
1818

1919
constructor(private readonly session: DebugSession, fileSystem: IFileSystem) {
@@ -47,6 +47,7 @@ class DebugSessionLoggingTracker implements DebugAdapterTracker {
4747

4848
public onExit(code: number | undefined, signal: string | undefined) {
4949
this.log(`Exit:\nExit-Code: ${code ? code : 0}\nSignal: ${signal ? signal : 'none'}\n`);
50+
this.stream?.close();
5051
}
5152

5253
private log(message: string) {

0 commit comments

Comments
 (0)