1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-29 22:53:44 +00:00

Revert "Use logService for console messages (#214)" (#219)

This reverts commit 0fed528b6f.
This commit is contained in:
Matt Gibson
2020-12-04 13:58:32 -06:00
committed by GitHub
parent 0fed528b6f
commit 2b8c2c2b3e
10 changed files with 61 additions and 141 deletions

View File

@@ -8,8 +8,6 @@ import { LogLevelType } from '../../enums/logLevelType';
import { LogService as LogServiceAbstraction } from '../../abstractions/log.service';
export class ElectronLogService implements LogServiceAbstraction {
private timersMap: Map<string, bigint> = new Map();
constructor(private filter: (level: LogLevelType) => boolean = null, logDir: string = null) {
if (log.transports == null) {
return;
@@ -63,17 +61,4 @@ export class ElectronLogService implements LogServiceAbstraction {
break;
}
}
time(label: string = 'default') {
if (!this.timersMap.has(label)) {
this.timersMap.set(label, process.hrtime.bigint());
}
}
timeEnd(label: string = 'default'): bigint {
const elapsed = (process.hrtime.bigint() - this.timersMap.get(label)) / BigInt(1000000);
this.timersMap.delete(label);
this.write(LogLevelType.Info, `${label}: ${elapsed}ms`);
return elapsed;
}
}