Skip to content

Commit b37d24c

Browse files
committed
Add logging
1 parent 0f73fa5 commit b37d24c

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

src/notebooks/controllers/controllerLoader.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,9 @@ export class ControllerLoader implements IControllerLoader, IExtensionSyncActiva
155155

156156
// If we have any out of date connections, dispose of them
157157
disposedControllers.forEach((controller) => {
158-
traceInfoIfCI(`Disposing controller ${controller.id}`);
158+
traceInfoIfCI(
159+
`Disposing controller ${controller.id}, associated with connection ${controller.connection.id}`
160+
);
159161
controller.dispose(); // This should remove it from the registered list
160162
});
161163

src/notebooks/controllers/controllerRegistration.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import {
3636
} from '../../platform/common/types';
3737
import { swallowExceptions } from '../../platform/common/utils/decorators';
3838
import { IServiceContainer } from '../../platform/ioc/types';
39-
import { traceError, traceWarning } from '../../platform/logging';
39+
import { traceError, traceVerbose, traceWarning } from '../../platform/logging';
4040
import { sendTelemetryEvent, Telemetry } from '../../telemetry';
4141
import { NotebookCellLanguageService } from '../languages/cellLanguageService';
4242
import { KernelFilterService } from './kernelFilter/kernelFilterService';
@@ -174,6 +174,7 @@ export class ControllerRegistration implements IControllerRegistration {
174174
controller.onNotebookControllerSelectionChanged((e) => {
175175
if (!e.selected && this.isFiltered(controller.connection)) {
176176
// This item was selected but is no longer allowed in the kernel list. Remove it
177+
traceVerbose(`Removing controller ${controller.id} from kernel list`);
177178
controller.dispose();
178179
}
179180
});

src/notebooks/controllers/vscodeNotebookController.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,14 @@ export class VSCodeNotebookController implements Disposable, IVSCodeNotebookCont
243243
}
244244

245245
public dispose() {
246+
traceVerbose(
247+
`Disposing controller ${this.id} associated with connection ${
248+
this.connection.id
249+
} and documents ${this.notebookApi.notebookDocuments
250+
.filter((item) => this.associatedDocuments.has(item))
251+
.map((item) => item.uri.toString())
252+
.join(', ')}`
253+
);
246254
if (!this.isDisposed) {
247255
this.isDisposed = true;
248256
this._onNotebookControllerSelected.dispose();

0 commit comments

Comments
 (0)