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

pull/1381/head
Audric Ackermann 5 years ago
parent 8710b7a9e8
commit 357421f161
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

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

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

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

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

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

@ -215,7 +215,7 @@ export class UpdateGroupMembersDialog extends React.Component<Props, State> {
private onMemberClicked(selected: any) { private onMemberClicked(selected: any) {
if (selected.existingMember && !this.props.isAdmin) { 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; return;
} }

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

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

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

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

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

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

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

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

Loading…
Cancel
Save