mirror of
https://github.com/bitwarden/browser
synced 2025-12-29 22:53:44 +00:00
This reverts commit 0fed528b6f.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user