Import log instead of using it off of window

This commit is contained in:
Josh Perez 2021-09-17 14:27:53 -04:00 committed by GitHub
parent 8eb0dd3116
commit 65ddf0a9e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
155 changed files with 3654 additions and 3433 deletions

View file

@ -4,6 +4,7 @@
import { without } from 'lodash';
import { StorageInterface } from '../../types/Storage.d';
import * as log from '../../logging/log';
const BLOCKED_NUMBERS_ID = 'blocked';
const BLOCKED_UUIDS_ID = 'blocked-uuids';
@ -26,7 +27,7 @@ export class Blocked {
return;
}
window.log.info('adding', number, 'to blocked list');
log.info('adding', number, 'to blocked list');
await this.storage.put(BLOCKED_NUMBERS_ID, numbers.concat(number));
}
@ -36,7 +37,7 @@ export class Blocked {
return;
}
window.log.info('removing', number, 'from blocked list');
log.info('removing', number, 'from blocked list');
await this.storage.put(BLOCKED_NUMBERS_ID, without(numbers, number));
}
@ -54,7 +55,7 @@ export class Blocked {
return;
}
window.log.info('adding', uuid, 'to blocked list');
log.info('adding', uuid, 'to blocked list');
await this.storage.put(BLOCKED_UUIDS_ID, uuids.concat(uuid));
}
@ -64,7 +65,7 @@ export class Blocked {
return;
}
window.log.info('removing', uuid, 'from blocked list');
log.info('removing', uuid, 'from blocked list');
await this.storage.put(BLOCKED_UUIDS_ID, without(numbers, uuid));
}
@ -82,7 +83,7 @@ export class Blocked {
return;
}
window.log.info(`adding group(${groupId}) to blocked list`);
log.info(`adding group(${groupId}) to blocked list`);
await this.storage.put(BLOCKED_GROUPS_ID, groupIds.concat(groupId));
}
@ -92,7 +93,7 @@ export class Blocked {
return;
}
window.log.info(`removing group(${groupId} from blocked list`);
log.info(`removing group(${groupId} from blocked list`);
await this.storage.put(BLOCKED_GROUPS_ID, without(groupIds, groupId));
}
}

View file

@ -6,6 +6,7 @@ import { WebAPICredentials } from '../Types.d';
import { strictAssert } from '../../util/assert';
import { StorageInterface } from '../../types/Storage.d';
import { UUID } from '../../types/UUID';
import * as log from '../../logging/log';
import Helpers from '../Helpers';
@ -26,7 +27,7 @@ export class User {
): Promise<void> {
await this.storage.put('uuid_id', `${uuid}.${deviceId}`);
window.log.info('storage.user: uuid and device id changed');
log.info('storage.user: uuid and device id changed');
}
public async setNumber(number: string): Promise<void> {
@ -40,7 +41,7 @@ export class User {
'Cannot update device number without knowing device id'
);
window.log.info('storage.user: number changed');
log.info('storage.user: number changed');
await Promise.all([
this.storage.put('number_id', `${number}.${deviceId}`),
@ -109,7 +110,7 @@ export class User {
}
public async removeCredentials(): Promise<void> {
window.log.info('storage.user: removeCredentials');
log.info('storage.user: removeCredentials');
await Promise.all([
this.storage.remove('number_id'),