Skip to content

Commit cbe6cdb

Browse files
authored
Log digest file name when updating trust (#12812)
1 parent 9d05058 commit cbe6cdb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/client/datascience/interactive-ipynb/digestStorage.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { inject, injectable } from 'inversify';
33
import * as os from 'os';
44
import * as path from 'path';
55
import { Uri } from 'vscode';
6-
import { traceError } from '../../common/logger';
6+
import { traceError, traceInfo } from '../../common/logger';
77
import { isFileNotFoundError } from '../../common/platform/errors';
88
import { IFileSystem } from '../../common/platform/types';
99
import { IExtensionContext } from '../../common/types';
@@ -13,6 +13,7 @@ import { IDigestStorage } from '../types';
1313
export class DigestStorage implements IDigestStorage {
1414
public readonly key: Promise<string>;
1515
private digestDir: Promise<string>;
16+
private loggedFileLocations = new Set();
1617

1718
constructor(
1819
@inject(IFileSystem) private fs: IFileSystem,
@@ -26,6 +27,10 @@ export class DigestStorage implements IDigestStorage {
2627
const fileLocation = await this.getFileLocation(uri);
2728
// Since the signature is a hex digest, the character 'z' is being used to delimit the start and end of a single digest
2829
await this.fs.appendFile(fileLocation, `z${signature}z\n`);
30+
if (!this.loggedFileLocations.has(fileLocation)) {
31+
traceInfo(`Wrote trust for ${uri.toString()} to ${fileLocation}`);
32+
this.loggedFileLocations.add(fileLocation);
33+
}
2934
}
3035

3136
public async containsDigest(uri: Uri, signature: string) {

0 commit comments

Comments
 (0)