rename window.console.log to window.log.info

This commit is contained in:
Audric Ackermann 2020-11-09 14:28:02 +11:00
parent 8710b7a9e8
commit 357421f161
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4
14 changed files with 23 additions and 24 deletions

View File

@ -247,7 +247,7 @@
},
async bumpTyping() {
if (this.isPublic()) {
window.console.debug('public conversation... No need to bumpTyping');
window.log.debug('public conversation... No need to bumpTyping');
return;
}
// We don't send typing messages if the setting is disabled or we do not have a session
@ -1273,7 +1273,7 @@
// Handle Group Invitation Message
if (groupInvitation) {
if (conversationType !== Message.PRIVATE) {
window.console.warning('Cannot send groupInvite to group chat');
window.log.warn('Cannot send groupInvite to group chat');
return null;
}
@ -1671,7 +1671,7 @@
);
const recipientPubKey = new libsession.Types.PubKey(recipient);
if (!recipientPubKey) {
window.console.warn('sendGroupInfo invalid pubkey:', recipient);
window.log.warn('sendGroupInfo invalid pubkey:', recipient);
return;
}
@ -1837,7 +1837,7 @@
read = read.filter(item => !item.hasErrors);
if (this.isPublic()) {
window.console.debug(
window.log.debug(
'public conversation... No need to send read receipt'
);
return;

View File

@ -180,7 +180,7 @@
const xor = _.xor(notPresentInNew, notPresentInOld);
if (xor.length === 0) {
window.console.log(
window.log.log(
'skipping group update: no detected changes in group member list'
);

View File

@ -19,7 +19,7 @@
const debugLogFn = (...args) => {
if (window.lokiFeatureFlags.debugMessageLogs) {
window.console.warn(...args);
window.log.warn(...args);
}
};

View File

@ -458,7 +458,7 @@
);
if (!secondaryDevicePubKey) {
window.console.error(
window.log.error(
'Invalid secondary pubkey on authoriseSecondaryDevice'
);

View File

@ -201,7 +201,7 @@ MessageSender.prototype = {
}
if (convosToSync.size === 0) {
window.console.info('No contacts to sync.');
window.log.info('No contacts to sync.');
return Promise.resolve();
}
@ -229,7 +229,7 @@ MessageSender.prototype = {
// primaryDevicePubKey is set to our own number if we are the master device
const primaryDeviceKey = window.storage.get('primaryDevicePubKey');
if (!primaryDeviceKey) {
window.console.debug('sendGroupSyncMessage: no primary device pubkey');
window.log.debug('sendGroupSyncMessage: no primary device pubkey');
return Promise.resolve();
}
// We only want to sync across closed groups that we haven't left
@ -237,7 +237,7 @@ MessageSender.prototype = {
c => c.isClosedGroup() && !c.get('left') && !c.get('isKickedFromGroup')
);
if (activeGroups.length === 0) {
window.console.info('No closed group to sync.');
window.log.info('No closed group to sync.');
return Promise.resolve();
}

View File

@ -215,7 +215,7 @@ export class UpdateGroupMembersDialog extends React.Component<Props, State> {
private onMemberClicked(selected: any) {
if (selected.existingMember && !this.props.isAdmin) {
window.console.warn('Only group admin can remove members!');
window.log.warn('Only group admin can remove members!');
return;
}

View File

@ -456,12 +456,12 @@ export class LeftPaneMessageSection extends React.Component<Props, State> {
openGroupConversation
);
} else {
window.console.error(
window.log.error(
'Joined an opengroup but did not find ther corresponding conversation'
);
}
} catch (e) {
window.console.error('Failed to connect to server:', e);
window.log.error('Failed to connect to server:', e);
ToastUtils.pushToastError(
'connectToServerFail',
window.i18n('connectToServerFail')

View File

@ -960,7 +960,7 @@ export class RegistrationTabs extends React.Component<{}, State> {
const secretWords = window.mnemonic.pubkey_to_secret_words(pubkey);
this.setState({ secretWords });
} catch (e) {
window.console.log(e);
window.log.log(e);
await this.resetRegistration();
this.setState({

View File

@ -80,7 +80,7 @@ async function decryptForMediumGroup(
const ourNumber = (await UserUtil.getCurrentDevicePubKey()) as string;
const sourceAsStr = StringUtils.decode(source, 'hex');
if (sourceAsStr === ourNumber) {
window.console.info(
window.log.info(
'Dropping message from ourself after decryptForMediumGroup'
);
return null;
@ -316,7 +316,7 @@ async function decrypt(
} else if (error instanceof window.textsecure.PreKeyMissing) {
const convo = window.ConversationController.get(envelope.source);
if (!convo) {
window.console.warn(
window.log.warn(
'PreKeyMissing but convo is missing too. Dropping...'
);
return;

View File

@ -659,7 +659,7 @@ export async function handleMessageEvent(event: MessageEvent): Promise<void> {
}
if (!conversationId) {
window.console.warn(
window.log.warn(
'Invalid conversation id for incoming message',
conversationId
);

View File

@ -40,7 +40,6 @@ export async function preprocessGroupMessage(
);
if (conversation.isPublic() || conversation.isMediumGroup()) {
// window.console.log('No need to preprocess public group chat messages');
return;
}
const GROUP_TYPES = SignalService.GroupContext.Type;

View File

@ -530,7 +530,7 @@ export async function handleMessageJob(
if (confirm) {
confirm();
}
window.console.log(
window.log.info(
'Dropping ExpireTimerUpdate message as we already have the same one set.'
);
return;

View File

@ -31,7 +31,7 @@ export async function handleSessionRequestMessage(
) {
const { libsignal, StringView, textsecure, dcodeIO, log } = window;
window.console.log(
window.log.info(
`Received SESSION_REQUEST from source: ${envelope.source}`
);
@ -74,7 +74,7 @@ export async function handleSessionRequestMessage(
);
}
if (preKey === undefined || signedKey === undefined) {
window.console.warn(
window.log.warn(
"Couldn't process prekey bundle without preKey or signedKey"
);
return;

View File

@ -102,7 +102,7 @@ async function handleSentMessage(
}
if (isMessageEmpty(msg as SignalService.DataMessage)) {
window.console.log('dropping empty message synced');
window.log.info('dropping empty message synced');
await removeFromCache(envelope);
return;
}
@ -193,11 +193,11 @@ async function handleBlocked(
if (conv.isPrivate()) {
await BlockedNumberController.setBlocked(n, block);
} else {
window.console.warn('Ignoring block/unblock for group:', n);
window.log.warn('Ignoring block/unblock for group:', n);
}
conv.trigger('change', conv);
} else {
window.console.warn(
window.log.warn(
'Did not find corresponding conversation to block',
n
);