cleanup console.logs and moved to proper log level console to make finding stray console.logs easier

This commit is contained in:
Henry Jameson 2025-01-28 16:28:23 +02:00
commit 7f9fe6b660
16 changed files with 50 additions and 59 deletions

View file

@ -61,9 +61,7 @@ export default {
},
methods: {
optionallyPrompt () {
console.log('Triggered')
if (this.shouldConfirm) {
console.log('SHAWN!!')
this.show()
} else {
this.doMute()

View file

@ -162,7 +162,6 @@ const EmojiPicker = {
} else {
emojiSizeReal = emojiSizeValue
}
console.log(emojiSizeReal)
const fullEmojiSize = emojiSizeReal + (2 * 0.2 * fontSizeMultiplier * 14)
this.emojiSize = fullEmojiSize
@ -319,7 +318,6 @@ const EmojiPicker = {
return this.emojiSize
},
itemPerRow () {
console.log('CALC', this.emojiSize, this.width)
return this.width ? Math.floor(this.width / this.emojiSize) : 6
},
activeGroupView () {

View file

@ -24,6 +24,6 @@ export const getBookmarkFolderEntries = state => state.bookmarkFolders.allFolder
routeObject: { name: 'bookmark-folder', params: { id: folder.id } },
labelRaw: folder.name,
iconEmoji: folder.emoji,
iconEmojiUrl: console.log(folder) || folder.emoji_url,
iconEmojiUrl: folder.emoji_url,
iconLetter: folder.name[0]
}))

View file

@ -130,7 +130,7 @@ export default {
const serialized = this.cValue.map(x => serializeShadow(x)).join(',')
serialized.split(/,/).map(deserializeShadow) // validate
const expandedShadow = flattenDeep(findShadow(this.cValue, { dynamicVars: {}, staticVars: this.staticVars }))
const fixedShadows = expandedShadow.map(x => ({ ...x, color: console.log(x) || rgb2hex(x.color) }))
const fixedShadows = expandedShadow.map(x => ({ ...x, color: rgb2hex(x.color) }))
if (this.separateInset) {
result = {

View file

@ -280,7 +280,6 @@ const Status = {
case 'nsfw': return this.$t('status.sensitive_muted')
}
}
console.log(this.status)
if (this.muteReasons.length > 1) {
return this.$t(
'status.multi_reason_mute',
@ -306,7 +305,7 @@ const Status = {
const relationshipReblog = reblog && this.$store.getters.relationship(reblog.user.id)
return (status.muted && !status.thread_muted) ||
// Reprööt of a muted post according to BE
(reblog && reblog.muted) ||
(reblog && reblog.muted && !reblog.thread_muted) ||
// Muted user
relationship.muting ||
// Muted user of a reprööt

View file

@ -2,23 +2,23 @@
const arg = process.argv[2]
if (typeof arg === 'undefined') {
console.log('This is a very simple and tiny tool that checks en.json with any other language and')
console.log('outputs all the things present in english but missing in foreign language.')
console.log('')
console.log('Usage: ./compare.js <lang> ')
console.log(' or')
console.log(' node ./compare.js <lang>')
console.log('')
console.log('Where <lang> is name of .json file containing language. For ./fi.json it should be:')
console.log(' ./compare.js fi ')
console.log('')
console.log('Limitations: ')
console.log('* This program does not work with languages left over in messages.js')
console.log('* This program does not check for extra strings present in foreign language but missing')
console.log(' in english.js (for now)')
console.log('')
console.log('There are no other arguments or options. Make an issue if you encounter a bug or want')
console.log('some feature to be implemented. Merge requests are welcome as well.')
console.info('This is a very simple and tiny tool that checks en.json with any other language and')
console.info('outputs all the things present in english but missing in foreign language.')
console.info('')
console.info('Usage: ./compare.js <lang> ')
console.info(' or')
console.info(' node ./compare.js <lang>')
console.info('')
console.info('Where <lang> is name of .json file containing language. For ./fi.json it should be:')
console.info(' ./compare.js fi ')
console.info('')
console.info('Limitations: ')
console.info('* This program does not work with languages left over in messages.js')
console.info('* This program does not check for extra strings present in foreign language but missing')
console.info(' in english.js (for now)')
console.info('')
console.info('There are no other arguments or options. Make an issue if you encounter a bug or want')
console.info('some feature to be implemented. Merge requests are welcome as well.')
process.exit()
}
@ -35,10 +35,10 @@ function walker (a, b, path = []) {
const article = aType[0] === 'o' ? 'an' : 'a'
if (bType === 'undefined') {
console.log(`Foreign language is missing ${article} ${aType} at path ${currentPath.join('.')}`)
console.warn(`Foreign language is missing ${article} ${aType} at path ${currentPath.join('.')}`)
} else if (aType === 'object') {
if (bType !== 'object') {
console.log(`Type mismatch! English has ${aType} while foreign has ${bType} at path ${currentPath.join['.']}`)
console.warn(`Type mismatch! English has ${aType} while foreign has ${bType} at path ${currentPath.join['.']}`)
} else {
walker(aVal, bVal, currentPath)
}

View file

@ -131,7 +131,6 @@ export const _getRecentData = (cache, live, isTest) => {
prefsStorage: _merge(a.prefsStorage, b.prefsStorage),
flagStorage: _merge(a.flagStorage, b.flagStorage)
})
console.log(result.recent)
result.recent = isTest ? result.recent : (result.recent && merge(defaultState, result.recent))
result.stale = isTest ? result.stale : (result.stale && merge(defaultState, result.stale))

View file

@ -276,8 +276,8 @@ const addNewStatuses = (state, { statuses, showImmediately = false, timeline, us
// NOOP, it is known status but we don't do anything about it for now
},
default: (unknown) => {
console.log('unknown status type')
console.log(unknown)
console.warn('unknown status type')
console.warn(unknown)
}
}

View file

@ -1,7 +1,7 @@
import { invertLightness, contrastRatio, convert } from 'chromatism'
// useful for visualizing color when debugging
export const consoleColor = (color) => console.log('%c##########', 'background: ' + color + '; color: ' + color)
// const consoleColor = (color) => console.debug('%c##########', 'background: ' + color + '; color: ' + color)
/**
* Convert r, g, b values into hex notation. All components are [0-255]