dispose the telemetry reporter (#446)
This commit is contained in:
parent
71a1f7bed4
commit
3691e8392b
|
@ -44,6 +44,7 @@ function initializeExtension(operationId: string, context: vscode.ExtensionConte
|
|||
});
|
||||
});
|
||||
|
||||
context.subscriptions.push(logger);
|
||||
context.subscriptions.push(vscode.debug.registerDebugConfigurationProvider("java", new JavaDebugConfigurationProvider()));
|
||||
context.subscriptions.push(instrumentAndRegisterCommand("JavaDebug.SpecifyProgramArgs", async () => {
|
||||
return specifyProgramArguments(context);
|
||||
|
|
|
@ -11,7 +11,7 @@ export enum Type {
|
|||
ACTIVATEEXTENSION = "activateExtension", // TODO: Activation belongs to usage data, remove this category.
|
||||
}
|
||||
|
||||
class Logger {
|
||||
class Logger implements vscode.Disposable {
|
||||
private reporter: TelemetryReporter = null;
|
||||
|
||||
public initialize(context: vscode.ExtensionContext): void {
|
||||
|
@ -43,6 +43,12 @@ class Logger {
|
|||
public logMessage(type: Type, message: string): void {
|
||||
this.log(type, { message });
|
||||
}
|
||||
|
||||
public dispose() {
|
||||
if (this.reporter) {
|
||||
this.reporter.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const logger = new Logger();
|
||||
|
|
Loading…
Reference in New Issue