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

@ -2,7 +2,7 @@
// SPDX-License-Identifier: AGPL-3.0-only
/* eslint-env node */
/* global log, Signal */
/* global Signal, window */
const fs = require('fs-extra');
const path = require('path');
@ -58,7 +58,7 @@ exports.createConversation = async ({
await Promise.all(
range(0, numMessages).map(async index => {
await sleep(index * 100);
log.info(`Create message ${index + 1}`);
window.SignalWindow.log.info(`Create message ${index + 1}`);
const message = await createRandomMessage({ conversationId });
return Signal.Data.saveMessage(message);
})
@ -108,7 +108,10 @@ const createRandomMessage = async ({ conversationId } = {}) => {
};
const message = _createMessage({ commonProperties, conversationId, type });
return Message.initializeSchemaVersion({ message, logger: log });
return Message.initializeSchemaVersion({
message,
logger: window.SignalWindow.log,
});
};
const _createMessage = ({ commonProperties, conversationId, type } = {}) => {