diff --git a/eslint.config.mjs b/eslint.config.mjs index 7e6b247a6e..5abec4249c 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -22,7 +22,7 @@ export default defineConfig([ }, }, rules: { - 'no-console': 'warn', + 'no-console': 'error', 'no-unused-vars': 'warn', // 'jsdoc/no-undefined-types': 'error', diff --git a/src/components/Composer.vue b/src/components/Composer.vue index 2081ca208b..6bbf7cc0fe 100644 --- a/src/components/Composer.vue +++ b/src/components/Composer.vue @@ -1008,7 +1008,7 @@ export default { }, aliases(newAliases) { - console.debug('aliases changed') + logger.debug('aliases changed') if (this.selectedAlias === NO_ALIAS_SET) { return } diff --git a/src/components/Envelope.vue b/src/components/Envelope.vue index c21e7d3c40..f2a381df03 100644 --- a/src/components/Envelope.vue +++ b/src/components/Envelope.vue @@ -717,7 +717,7 @@ export default { hasMultipleRecipients() { if (!this.account) { - console.error('account is undefined', { + logger.error('account is undefined', { accountId: this.data.accountId, }) } diff --git a/src/components/MenuEnvelope.vue b/src/components/MenuEnvelope.vue index 848c075fa1..0f1fe735ce 100644 --- a/src/components/MenuEnvelope.vue +++ b/src/components/MenuEnvelope.vue @@ -384,7 +384,7 @@ export default { hasMultipleRecipients() { if (!this.account) { - console.error('account is undefined', { + logger.error('account is undefined', { accountId: this.envelope.accountId, }) } diff --git a/src/components/MessageAttachments.vue b/src/components/MessageAttachments.vue index 3348b097c1..6cc1a587c3 100644 --- a/src/components/MessageAttachments.vue +++ b/src/components/MessageAttachments.vue @@ -136,7 +136,6 @@ export default { }, mounted() { - console.log(this.attachments) let prevTop = null this.visible = 0 this.$nextTick(function() { diff --git a/src/components/MessagePlainTextBody.vue b/src/components/MessagePlainTextBody.vue index 1318158af7..fd0813a84a 100644 --- a/src/components/MessagePlainTextBody.vue +++ b/src/components/MessagePlainTextBody.vue @@ -77,8 +77,6 @@ export default { }, signatureSummary() { - console.info(this.signature.match(regFirstParagraph)) - return this.signatureSummaryAndBody.summary }, }, diff --git a/src/components/NavigationAccount.vue b/src/components/NavigationAccount.vue index 797ec33081..4bedb0027e 100644 --- a/src/components/NavigationAccount.vue +++ b/src/components/NavigationAccount.vue @@ -294,14 +294,14 @@ export default { onMenuToggle(open) { if (open && this.account.quotaPercentage !== null) { - console.debug('accounts menu opened, fetching quota') + logger.debug('accounts menu opened, fetching quota') this.fetchQuota() } }, async fetchQuota() { const quota = await fetchQuota(this.account.id) - console.debug('quota fetched', { + logger.debug('quota fetched', { quota, }) diff --git a/src/components/NavigationMailbox.vue b/src/components/NavigationMailbox.vue index 622cd87bca..4754fe73df 100644 --- a/src/components/NavigationMailbox.vue +++ b/src/components/NavigationMailbox.vue @@ -727,7 +727,7 @@ export default { this.renameInput = false } catch (error) { showInfo(t('mail', 'An error occurred, unable to rename the mailbox.')) - console.error(error) + logger.error('could not rename mailbox', { error }) } finally { this.showSaving = false } diff --git a/src/components/NewMessageModal.vue b/src/components/NewMessageModal.vue index 1a4ccb75e3..406d2df9b3 100644 --- a/src/components/NewMessageModal.vue +++ b/src/components/NewMessageModal.vue @@ -285,7 +285,7 @@ export default { const sizePreference = this.mainStore.getPreference('modalSize') this.largerModal = sizePreference === 'large' } catch (error) { - console.error('Error getting modal size preference', error) + logger.error('Error getting modal size preference', { error }) } }, @@ -298,7 +298,7 @@ export default { value: this.largerModal ? 'large' : 'normal', }) } catch (error) { - console.error('Failed to save preference', error) + logger.error('Failed to save preference', { error }) } }, @@ -623,7 +623,7 @@ export default { e.returnValue = true this.mainStore.showMessageComposerMutation() } else { - console.info('No unsaved changes. See you!') + logger.debug('no unsaved changes, closing') } }, diff --git a/src/components/RecipientBubble.vue b/src/components/RecipientBubble.vue index f39fd097fc..96d0952275 100644 --- a/src/components/RecipientBubble.vue +++ b/src/components/RecipientBubble.vue @@ -125,6 +125,7 @@ import IconClose from 'vue-material-design-icons/CloseOutline.vue' import IconDetails from 'vue-material-design-icons/InformationOutline.vue' import IconAdd from 'vue-material-design-icons/Plus.vue' import IconReply from 'vue-material-design-icons/ReplyOutline.vue' +import logger from '../logger.js' import { fetchAvatarUrlMemoized } from '../service/AvatarService.js' import { addToContact, autoCompleteByName, findMatches, newContact } from '../service/ContactIntegrationService.js' @@ -215,7 +216,7 @@ export default { try { this.avatarUrl = await fetchAvatarUrlMemoized(this.email) } catch (error) { - console.debug('no avatar for ' + this.email, { + logger.debug('no avatar for ' + this.email, { error, }) } @@ -258,11 +259,11 @@ export default { onClickAddToContact() { if (this.selection === ContactSelectionStateEnum.new) { if (this.newContactName !== '') { - newContact(this.newContactName.trim(), this.email).then((res) => console.debug('ContactIntegration', res)) + newContact(this.newContactName.trim(), this.email).then((res) => logger.debug('ContactIntegration', { res })) } } else if (this.selection === ContactSelectionStateEnum.existing) { if (this.selectedContact) { - addToContact(this.selectedContact.id, this.email).then((res) => console.debug('ContactIntegration', res)) + addToContact(this.selectedContact.id, this.email).then((res) => logger.debug('ContactIntegration', { res })) } } }, diff --git a/src/components/TagItem.vue b/src/components/TagItem.vue index 6874955d10..9ae137e72a 100644 --- a/src/components/TagItem.vue +++ b/src/components/TagItem.vue @@ -68,6 +68,7 @@ import { NcActionInput as ActionInput, NcActions as Actions, NcActionText as Act import { mapStores } from 'pinia' import IconEdit from 'vue-material-design-icons/PencilOutline.vue' import DeleteIcon from 'vue-material-design-icons/TrashCanOutline.vue' +import logger from '../logger.js' import useMainStore from '../store/mainStore.js' import { translateTagDisplayName } from '../util/tag.js' @@ -131,7 +132,7 @@ export default { this.showSaving = false } catch (error) { showInfo(t('mail', 'An error occurred, unable to rename the tag.')) - console.error(error) + logger.error('could not rename tag', { error }) this.showSaving = true } }, @@ -159,7 +160,7 @@ export default { this.showSaving = false } catch (error) { showInfo(t('mail', 'An error occurred, unable to rename the tag.')) - console.error(error) + logger.error('could not rename tag', { error }) this.renameTagLabel = false this.renameTagInput = false this.showSaving = true diff --git a/src/components/TagModal.vue b/src/components/TagModal.vue index c95b87d8d1..acd7f13eec 100644 --- a/src/components/TagModal.vue +++ b/src/components/TagModal.vue @@ -59,6 +59,7 @@ import IconAdd from 'vue-material-design-icons/Plus.vue' import IconTag from 'vue-material-design-icons/TagOutline.vue' import DeleteTagModal from './DeleteTagModal.vue' import TagItem from './TagItem.vue' +import logger from '../logger.js' import useMainStore from '../store/mainStore.js' import { hiddenTags } from './tags.js' @@ -179,7 +180,7 @@ export default { color: randomColor(displayName), }) } catch (error) { - console.debug(error) + logger.error('could not create tag', { error }) showError(this.t('mail', 'An error occurred, unable to create the tag.')) } finally { this.showSaving = false @@ -223,7 +224,7 @@ export default { this.showSaving = false } catch (error) { showInfo(t('mail', 'An error occurred, unable to rename the tag.')) - console.error(error) + logger.error('could not rename tag', { error }) this.renameTagLabel = false this.renameTagInput = false this.showSaving = true diff --git a/src/components/TextEditor.vue b/src/components/TextEditor.vue index 02cc57bc7d..c7e7889760 100644 --- a/src/components/TextEditor.vue +++ b/src/components/TextEditor.vue @@ -483,7 +483,7 @@ export default { this.editorInstance.editing.view.focus() }) .catch((error) => { - console.debug('Smart picker promise rejected:', error) + logger.debug('Smart picker promise rejected', { error }) }) } if (eventData.marker === '@') { diff --git a/src/components/Thread.vue b/src/components/Thread.vue index fff595fc44..91835960f4 100644 --- a/src/components/Thread.vue +++ b/src/components/Thread.vue @@ -129,7 +129,7 @@ export default { threadSubject() { const thread = this.thread if (thread.length === 0) { - console.warn('thread is empty') + logger.warn('thread is empty') return '' } return thread[0].subject || this.t('mail', 'No subject') @@ -188,10 +188,10 @@ export default { return } if (!this.expandedThreads.includes(threadId)) { - console.debug(`expand thread ${threadId}`) + logger.debug(`expand thread ${threadId}`) this.expandedThreads.push(threadId) } else { - console.debug(`collapse thread ${threadId}`) + logger.debug(`collapse thread ${threadId}`) this.expandedThreads = this.expandedThreads.filter((t) => t !== threadId) } }, diff --git a/src/components/ThreadEnvelope.vue b/src/components/ThreadEnvelope.vue index b6f57e31d0..745d9fb7b9 100644 --- a/src/components/ThreadEnvelope.vue +++ b/src/components/ThreadEnvelope.vue @@ -583,7 +583,7 @@ export default { hasMultipleRecipients() { if (!this.account) { - console.error('account is undefined', { + logger.error('account is undefined', { accountId: this.envelope.accountId, }) } diff --git a/src/components/TranslationModal.vue b/src/components/TranslationModal.vue index 2734aa1d88..1f80d9d8d3 100644 --- a/src/components/TranslationModal.vue +++ b/src/components/TranslationModal.vue @@ -88,6 +88,7 @@ import { mapState } from 'pinia' import WarningIcon from 'vue-material-design-icons/AlertOctagonOutline.vue' import ArrowRight from 'vue-material-design-icons/ArrowRight.vue' import ContentCopy from 'vue-material-design-icons/ContentCopy.vue' +import logger from '../logger.js' import { translateText } from '../service/translationService.js' import useMainStore from '../store/mainStore.js' @@ -175,7 +176,7 @@ export default { const response = await translateText(this.message.trim(), this.selectedFrom.value, this.selectedTo.value) this.translatedMessage = response } catch (error) { - console.error(error) + logger.error('could not translate message', { error }) showError(error.response?.data?.ocs?.data?.message ?? t('mail', 'The message could not be translated')) } finally { this.isLoading = false diff --git a/src/components/itinerary/CalendarImport.vue b/src/components/itinerary/CalendarImport.vue index 9e17c09559..9cab2038a3 100644 --- a/src/components/itinerary/CalendarImport.vue +++ b/src/components/itinerary/CalendarImport.vue @@ -27,6 +27,7 @@ import moment from '@nextcloud/moment' import { NcActionButton as ActionButton, NcActions as Actions, NcLoadingIcon as IconLoading } from '@nextcloud/vue' import ical from 'ical.js' import IconAdd from 'vue-material-design-icons/Plus.vue' +import logger from '../../logger.js' export default { name: 'CalendarImport', @@ -63,7 +64,7 @@ export default { calendar.loading = true this.handler(calendar) - .catch(console.error.bind(this)) + .catch((error) => logger.error('could not import calendar event', { error })) .then(() => { calendar.loading = false }) diff --git a/src/i18n/MailboxTranslator.js b/src/i18n/MailboxTranslator.js index 4406cab345..b8f866309e 100644 --- a/src/i18n/MailboxTranslator.js +++ b/src/i18n/MailboxTranslator.js @@ -4,6 +4,7 @@ */ import { translate as t } from '@nextcloud/l10n' +import logger from '../logger.js' function translateSpecial(mailbox) { if (mailbox.specialUse.includes('all')) { @@ -54,7 +55,7 @@ export function translate(mailbox) { try { return translateSpecial(mailbox) } catch (e) { - console.error('could not translate special mailbox', e) + logger.error('could not translate special mailbox', { error: e }) } } return mailbox.displayName diff --git a/src/init.js b/src/init.js index 980c886668..d23a556aa5 100644 --- a/src/init.js +++ b/src/init.js @@ -3,13 +3,14 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ import { loadState } from '@nextcloud/initial-state' +import logger from './logger.js' import { fixAccountId } from './service/AccountService.js' import { fetchAvailableLanguages } from './service/translationService.js' import useMainStore from './store/mainStore.js' import useOutboxStore from './store/outboxStore.js' export default function initAfterAppCreation() { - console.debug('Init after app creation') + logger.debug('Init after app creation') const mainStore = useMainStore() const preferences = loadState('mail', 'preferences', []) diff --git a/src/service/FileSharingService.js b/src/service/FileSharingService.js index 006b9ef846..9b5ef16497 100644 --- a/src/service/FileSharingService.js +++ b/src/service/FileSharingService.js @@ -9,6 +9,7 @@ import axios from '@nextcloud/axios' import { showError } from '@nextcloud/dialogs' import { generateOcsUrl } from '@nextcloud/router' +import logger from '../logger.js' /** * Makes a share link for a given file or directory. @@ -33,11 +34,11 @@ async function shareFile(path, token) { && error.response.data.ocs.meta && error.response.data.ocs.meta.message ) { - console.error(`Error while sharing file: ${error.response.data.ocs.meta.message || 'Unknown error'}`) + logger.error(`Error while sharing file: ${error.response.data.ocs.meta.message || 'Unknown error'}`, { error }) showError(error.response.data.ocs.meta.message) throw error } else { - console.error('Error while sharing file: Unknown error') + logger.error('Error while sharing file: Unknown error', { error }) showError(t('mail', 'Error while sharing file')) throw error } diff --git a/src/service/translationService.js b/src/service/translationService.js index 85923be79d..3f1e264d39 100644 --- a/src/service/translationService.js +++ b/src/service/translationService.js @@ -5,6 +5,7 @@ import axios from '@nextcloud/axios' import { generateOcsUrl } from '@nextcloud/router' +import logger from '../logger.js' import useMainStore from '../store/mainStore.js' async function fetchAvailableLanguages() { @@ -23,7 +24,7 @@ async function fetchAvailableLanguages() { mainStore.translationInputLanguages = inputLanguages mainStore.translationOutputLanguages = outputLanguages } catch (e) { - console.error('Failed to fetch available languages', e) + logger.error('Failed to fetch available languages', { error: e }) } } diff --git a/src/store/mainStore/actions.js b/src/store/mainStore/actions.js index 5901231bf9..bc6df484b2 100644 --- a/src/store/mainStore/actions.js +++ b/src/store/mainStore/actions.js @@ -347,7 +347,7 @@ export default function mainStoreActions() { ? account.personalNamespace + name : name const mailbox = await createMailbox(account.id, prefixed) - console.debug(`mailbox ${prefixed} created for account ${account.id}`, { mailbox }) + logger.debug(`mailbox ${prefixed} created for account ${account.id}`, { mailbox }) this.addMailboxMutation({ account, mailbox, @@ -804,7 +804,7 @@ export default function mainStoreActions() { const mailboxesToFetch = (accounts) => pipe( findIndividualMailboxes(this.getMailboxes, mailbox.specialRole), - tap((mbs) => console.info('individual mailboxes', mbs)), + tap((mbs) => logger.info('individual mailboxes', { mbs })), filter(needsFetch(query, nextLocalUnifiedEnvelopes(accounts))), )(accounts) const mbs = mailboxesToFetch(this.getAccounts) @@ -843,12 +843,12 @@ export default function mainStoreActions() { const list = mailbox.envelopeLists[normalizedEnvelopeListId(query)] if (list === undefined) { - console.warn("envelope list is not defined, can't fetch next envelopes", mailboxId, query) + logger.warn("envelope list is not defined, can't fetch next envelopes", { mailboxId, query }) return Promise.resolve([]) } const lastEnvelopeId = last(list) if (typeof lastEnvelopeId === 'undefined') { - console.error('mailbox is empty', list) + logger.error('mailbox is empty', { list }) return Promise.reject(new Error('Local mailbox has no envelopes, cannot determine cursor')) } const lastEnvelope = this.getEnvelope(lastEnvelopeId) @@ -961,7 +961,7 @@ export default function mainStoreActions() { .catch((error) => { return matchError(error, { [SyncIncompleteError.getName()]: () => { - console.warn(`(initial) sync of mailbox ${mailboxId} (${query}) is incomplete, retriggering`) + logger.warn(`(initial) sync of mailbox ${mailboxId} (${query}) is incomplete, retriggering`) return this.syncEnvelopes({ mailboxId, query, @@ -982,7 +982,7 @@ export default function mainStoreActions() { })) }, default(error) { - console.error('Could not sync envelopes: ' + error.message, error) + logger.error('Could not sync envelopes: ' + error.message, { error }) throw error }, }) @@ -1110,7 +1110,7 @@ export default function mainStoreActions() { seen: newState, }) } catch (error) { - console.error('could not toggle message seen state', error) + logger.error('could not toggle message seen state', { error }) // Revert change this.flagEnvelopeMutation({ @@ -1151,7 +1151,7 @@ export default function mainStoreActions() { $notjunk: oldState, }) } catch (error) { - console.error('could not toggle message junk state', error) + logger.error('could not toggle message junk state', { error }) if (removeEnvelope) { this.addEnvelopesMutation([envelope]) @@ -1191,7 +1191,7 @@ export default function mainStoreActions() { flagged: favFlag, }) } catch (error) { - console.error('could not favorite/unfavorite message ' + envelope.uid, error) + logger.error('could not favorite/unfavorite message ' + envelope.uid, { error }) // Revert change this.flagEnvelopeMutation({ @@ -1279,7 +1279,7 @@ export default function mainStoreActions() { return handleHttpAuthErrors(async () => { const internalAddress = await addInternalAddress(address, type) this.addInternalAddressMutation(internalAddress) - console.debug('internal address added') + logger.debug('internal address added') }) }, async removeInternalAddress({ @@ -1291,9 +1291,9 @@ export default function mainStoreActions() { try { await removeInternalAddress(address, type) this.removeInternalAddressMutation({ addressId: id }) - console.debug('internal address removed') + logger.debug('internal address removed') } catch (error) { - console.error('could not delete internal address', error) + logger.error('could not delete internal address', { error }) throw error } }) @@ -1305,9 +1305,9 @@ export default function mainStoreActions() { try { await deleteMessage(id) this.removeMessageMutation({ id }) - console.debug('message removed') + logger.debug('message removed') } catch (err) { - console.error('could not delete message', err) + logger.error('could not delete message', { error: err }) const envelope = this.getEnvelope(id) if (envelope) { this.addEnvelopesMutation({ envelopes: [envelope] }) @@ -1395,7 +1395,7 @@ export default function mainStoreActions() { name: newName, }) - console.debug(`mailbox ${mailbox.databaseId} renamed to ${newName}`, { mailbox }) + logger.debug(`mailbox ${mailbox.databaseId} renamed to ${newName}`, { mailbox }) this.removeMailboxMutation({ id: mailbox.databaseId }) this.addMailboxMutation({ account, @@ -1543,10 +1543,10 @@ export default function mainStoreActions() { try { await ThreadService.deleteThread(envelope.databaseId) - console.debug('thread removed') + logger.debug('thread removed') } catch (e) { this.addEnvelopesMutation({ envelopes: [envelope] }) - console.error('could not delete thread', e) + logger.error('could not delete thread', { error: e }) throw e } }) @@ -1560,10 +1560,10 @@ export default function mainStoreActions() { try { await ThreadService.moveThread(envelope.databaseId, destMailboxId) - console.debug('thread removed') + logger.debug('thread moved') } catch (e) { this.addEnvelopesMutation({ envelopes: [envelope] }) - console.error('could not move thread', e) + logger.error('could not move thread', { error: e }) throw e } }) @@ -1576,10 +1576,10 @@ export default function mainStoreActions() { return handleHttpAuthErrors(async () => { try { await ThreadService.snoozeThread(envelope.databaseId, unixTimestamp, destMailboxId) - console.debug('thread snoozed') + logger.debug('thread snoozed') } catch (e) { this.addEnvelopesMutation({ envelopes: [envelope] }) - console.error('could not snooze thread', e) + logger.error('could not snooze thread', { error: e }) throw e } this.removeEnvelopeMutation({ id: envelope.databaseId }) @@ -1589,9 +1589,9 @@ export default function mainStoreActions() { return handleHttpAuthErrors(async () => { try { await ThreadService.unSnoozeThread(envelope.databaseId) - console.debug('thread unSnoozed') + logger.debug('thread unSnoozed') } catch (e) { - console.error('could not unsnooze thread', e) + logger.error('could not unsnooze thread', { error: e }) throw e } this.removeEnvelopeMutation({ id: envelope.databaseId }) @@ -2154,7 +2154,7 @@ export default function mainStoreActions() { removeEnvelopeMutation({ id }) { const envelope = this.envelopes[id] if (!envelope) { - console.warn('envelope ' + id + ' is unknown, can\'t remove it') + logger.warn('envelope ' + id + ' is unknown, can\'t remove it') return } const mailbox = this.mailboxes[envelope.mailboxId] @@ -2167,7 +2167,7 @@ export default function mainStoreActions() { if (idx < 0) { continue } - console.debug('envelope ' + id + ' removed from mailbox list ' + listId) + logger.debug('envelope ' + id + ' removed from mailbox list ' + listId) list.splice(idx, 1) } @@ -2186,16 +2186,10 @@ export default function mainStoreActions() { const list = mailbox.envelopeLists[listId] const idx = list.indexOf(id) if (idx < 0) { - console.warn( - 'envelope does not exist in unified mailbox', - mailbox.databaseId, - id, - listId, - list, - ) + logger.warn('envelope does not exist in unified mailbox', { mailboxId: mailbox.databaseId, id, listId, list }) continue } - console.debug('envelope removed from unified mailbox', mailbox.databaseId, id) + logger.debug('envelope removed from unified mailbox', { mailboxId: mailbox.databaseId, id }) list.splice(idx, 1) } }) @@ -2466,7 +2460,7 @@ export default function mainStoreActions() { return this.messages[id] }, getEnvelopeThread(id) { - console.debug('get thread for envelope', id, this.envelopes[id], this.envelopes) + logger.debug('get thread for envelope', { id, envelope: this.envelopes[id] }) const thread = this.envelopes[id]?.thread ?? [] const envelopes = thread.map((id) => this.envelopes[id]) return sortBy(prop('dateInt'), envelopes) diff --git a/src/task.js b/src/task.js index 80c29797e2..a160fb0888 100644 --- a/src/task.js +++ b/src/task.js @@ -7,6 +7,7 @@ import moment from '@nextcloud/moment' import ICAL from 'ical.js' import { v4 as uuid } from 'uuid' +import logger from './logger.js' export default class Task { /** @@ -54,7 +55,7 @@ export default class Task { } if (!this.vtodo.hasProperty('uid')) { - console.debug('This task did not have a proper uid. Setting a new one for ', this) + logger.debug('task did not have a proper uid, setting a new one') this.vtodo.addPropertyWithValue('uid', uuid()) } diff --git a/src/util/CrashReport.js b/src/util/CrashReport.js index 1e7a195189..6d74c1322c 100644 --- a/src/util/CrashReport.js +++ b/src/util/CrashReport.js @@ -4,6 +4,7 @@ */ import IssueTemplateBuilder from 'nextcloud_issuetemplate_builder' +import logger from '../logger.js' function flattenError(error) { let text = '' @@ -37,7 +38,7 @@ function flattenTrace(trace) { } export function getReportUrl(error) { - console.error(error) + logger.error('crash report', { error }) let message = error.message || 'An unkown error occurred.' if (!message.endsWith('.')) { message += '.' diff --git a/src/views/Home.vue b/src/views/Home.vue index 67c4259c93..56fad9e960 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -115,7 +115,7 @@ export default { // FIXME: this assumes that there's at least one mailbox const firstMailbox = this.mainStore.getMailboxes(firstAccount.id)[0] - console.debug('loading first mailbox of first account', firstAccount.id, firstMailbox.databaseId) + logger.debug('loading first mailbox of first account', { accountId: firstAccount.id, mailboxId: firstMailbox.databaseId }) this.$router.replace({ name: 'mailbox', @@ -130,7 +130,7 @@ export default { }) } else if (this.$route.name === 'mailto') { if (accounts.length === 0) { - console.error('cannot handle mailto:, no accounts configured') + logger.error('cannot handle mailto:, no accounts configured') return } @@ -139,7 +139,7 @@ export default { // FIXME: this assumes that there's at least one mailbox const firstMailbox = this.mainStore.getMailboxes(firstAccount.id)[0] - console.debug('loading composer with first account and folder', firstAccount.id, firstMailbox.id) + logger.debug('loading composer with first account and folder', { accountId: firstAccount.id, mailboxId: firstMailbox.id }) this.$router.replace({ name: 'message',