Optional PII logging (#11322)

* Start with logger

* allow user to enable PII logging

* prefix the log
This commit is contained in:
Amir Omidi
2020-07-13 13:05:00 -07:00
committed by GitHub
parent 347c193455
commit ff979f90d1
7 changed files with 86 additions and 25 deletions

View File

@@ -42,6 +42,7 @@ import * as azureResourceUtils from './azureResource/utils';
import * as utils from './utils';
import * as loc from './localizedConstants';
import { AzureResourceGroupService } from './azureResource/providers/resourceGroup/resourceGroupService';
import { Logger } from './utils/Logger';
let extensionContext: vscode.ExtensionContext;
@@ -76,6 +77,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<azurec
if (!storagePath) {
return undefined;
}
updatePiiLoggingLevel(apiWrapper);
// Create the provider service and activate
initAzureAccountProvider(extensionContext, storagePath).catch((err) => console.log(err));
@@ -164,5 +166,15 @@ async function onDidChangeConfiguration(e: vscode.ConfigurationChangeEvent, apiW
if (response === loc.reload) {
await apiWrapper.executeCommand('workbench.action.reloadWindow');
}
return;
}
if (e.affectsConfiguration('azure.piiLogging')) {
updatePiiLoggingLevel(apiWrapper);
}
}
function updatePiiLoggingLevel(apiWrapper: ApiWrapper) {
const piiLogging: boolean = apiWrapper.getExtensionConfiguration().get('piiLogging');
Logger.piiLogging = piiLogging;
}