Skip to content

Commit de964d8

Browse files
Merge pull request #12919 from nextcloud/fix/lint/no-console
refactor: migrate console calls to logger
2 parents 9aea6ee + 42f57d8 commit de964d8

25 files changed

Lines changed: 73 additions & 71 deletions

eslint.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default defineConfig([
2222
},
2323
},
2424
rules: {
25-
'no-console': 'warn',
25+
'no-console': 'error',
2626
'no-unused-vars': 'warn',
2727

2828
// 'jsdoc/no-undefined-types': 'error',

src/components/Composer.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1008,7 +1008,7 @@ export default {
10081008
},
10091009
10101010
aliases(newAliases) {
1011-
console.debug('aliases changed')
1011+
logger.debug('aliases changed')
10121012
if (this.selectedAlias === NO_ALIAS_SET) {
10131013
return
10141014
}

src/components/Envelope.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ export default {
717717
718718
hasMultipleRecipients() {
719719
if (!this.account) {
720-
console.error('account is undefined', {
720+
logger.error('account is undefined', {
721721
accountId: this.data.accountId,
722722
})
723723
}

src/components/MenuEnvelope.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ export default {
384384
385385
hasMultipleRecipients() {
386386
if (!this.account) {
387-
console.error('account is undefined', {
387+
logger.error('account is undefined', {
388388
accountId: this.envelope.accountId,
389389
})
390390
}

src/components/MessageAttachments.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ export default {
136136
},
137137
138138
mounted() {
139-
console.log(this.attachments)
140139
let prevTop = null
141140
this.visible = 0
142141
this.$nextTick(function() {

src/components/MessagePlainTextBody.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ export default {
7777
},
7878
7979
signatureSummary() {
80-
console.info(this.signature.match(regFirstParagraph))
81-
8280
return this.signatureSummaryAndBody.summary
8381
},
8482
},

src/components/NavigationAccount.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,14 +294,14 @@ export default {
294294
295295
onMenuToggle(open) {
296296
if (open && this.account.quotaPercentage !== null) {
297-
console.debug('accounts menu opened, fetching quota')
297+
logger.debug('accounts menu opened, fetching quota')
298298
this.fetchQuota()
299299
}
300300
},
301301
302302
async fetchQuota() {
303303
const quota = await fetchQuota(this.account.id)
304-
console.debug('quota fetched', {
304+
logger.debug('quota fetched', {
305305
quota,
306306
})
307307

src/components/NavigationMailbox.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ export default {
727727
this.renameInput = false
728728
} catch (error) {
729729
showInfo(t('mail', 'An error occurred, unable to rename the mailbox.'))
730-
console.error(error)
730+
logger.error('could not rename mailbox', { error })
731731
} finally {
732732
this.showSaving = false
733733
}

src/components/NewMessageModal.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ export default {
285285
const sizePreference = this.mainStore.getPreference('modalSize')
286286
this.largerModal = sizePreference === 'large'
287287
} catch (error) {
288-
console.error('Error getting modal size preference', error)
288+
logger.error('Error getting modal size preference', { error })
289289
}
290290
},
291291
@@ -298,7 +298,7 @@ export default {
298298
value: this.largerModal ? 'large' : 'normal',
299299
})
300300
} catch (error) {
301-
console.error('Failed to save preference', error)
301+
logger.error('Failed to save preference', { error })
302302
}
303303
},
304304
@@ -623,7 +623,7 @@ export default {
623623
e.returnValue = true
624624
this.mainStore.showMessageComposerMutation()
625625
} else {
626-
console.info('No unsaved changes. See you!')
626+
logger.debug('no unsaved changes, closing')
627627
}
628628
},
629629

src/components/RecipientBubble.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ import IconClose from 'vue-material-design-icons/CloseOutline.vue'
125125
import IconDetails from 'vue-material-design-icons/InformationOutline.vue'
126126
import IconAdd from 'vue-material-design-icons/Plus.vue'
127127
import IconReply from 'vue-material-design-icons/ReplyOutline.vue'
128+
import logger from '../logger.js'
128129
import { fetchAvatarUrlMemoized } from '../service/AvatarService.js'
129130
import { addToContact, autoCompleteByName, findMatches, newContact } from '../service/ContactIntegrationService.js'
130131
@@ -215,7 +216,7 @@ export default {
215216
try {
216217
this.avatarUrl = await fetchAvatarUrlMemoized(this.email)
217218
} catch (error) {
218-
console.debug('no avatar for ' + this.email, {
219+
logger.debug('no avatar for ' + this.email, {
219220
error,
220221
})
221222
}
@@ -258,11 +259,11 @@ export default {
258259
onClickAddToContact() {
259260
if (this.selection === ContactSelectionStateEnum.new) {
260261
if (this.newContactName !== '') {
261-
newContact(this.newContactName.trim(), this.email).then((res) => console.debug('ContactIntegration', res))
262+
newContact(this.newContactName.trim(), this.email).then((res) => logger.debug('ContactIntegration', { res }))
262263
}
263264
} else if (this.selection === ContactSelectionStateEnum.existing) {
264265
if (this.selectedContact) {
265-
addToContact(this.selectedContact.id, this.email).then((res) => console.debug('ContactIntegration', res))
266+
addToContact(this.selectedContact.id, this.email).then((res) => logger.debug('ContactIntegration', { res }))
266267
}
267268
}
268269
},

0 commit comments

Comments
 (0)