diff --git a/build/build.js b/build/build.js index 8242bc5f6f3180715318fcbd9169af2a1796fbf6..99ca49c060e5137ef77bb58bdadc39d225afe633 100644 --- a/build/build.js +++ b/build/build.js @@ -9,7 +9,7 @@ var ora = require('ora') var webpack = require('webpack') var webpackConfig = require('./webpack.prod.conf') -console.log( +console.info( ' Tip:\n' + ' Built files are meant to be served over an HTTP server.\n' + ' Opening index.html over file:// won\'t work.\n' diff --git a/build/check-versions.js b/build/check-versions.js index a269a5bc36f2e0324786ec2addb899f36d8e5792..ed6256b3af4cd4eca63fc1af9c9833d490275c2d 100644 --- a/build/check-versions.js +++ b/build/check-versions.js @@ -27,14 +27,12 @@ module.exports = function () { } if (warnings.length) { - console.log('') - console.log(chalk.yellow('To use this template, you must update following to modules:')) - console.log() + console.warn(chalk.yellow('\nTo use this template, you must update following to modules:\n')) for (var i = 0; i < warnings.length; i++) { var warning = warnings[i] - console.log(' ' + warning) + console.warn(' ' + warning) } - console.log() + console.warn() process.exit(1) } } diff --git a/build/dev-server.js b/build/dev-server.js index e51ba948496cad48b65f1129897b98a4a5254495..145072e70ac6c3b2f46a6ae958b9b252d93b417e 100644 --- a/build/dev-server.js +++ b/build/dev-server.js @@ -72,10 +72,10 @@ app.use(staticPath, express.static('./static')) module.exports = app.listen(port, function (err) { if (err) { - console.log(err) + console.error(err) return } var uri = 'http://localhost:' + port - console.log('Listening at ' + uri + '\n') + console.info('Listening at ' + uri + '\n') // opn(uri) }) diff --git a/config/index.js b/config/index.js index 023d4c9bced973028c1888d8fabca2f777684210..ff89274ad42860c9c49dea4d2957bf3ac4eec8a1 100644 --- a/config/index.js +++ b/config/index.js @@ -8,10 +8,10 @@ try { // and that's how actual BE reports its url settings.target = settings.target.replace(/\/$/, '') } - console.log('Using local dev server settings (/config/local.json):') - console.log(JSON.stringify(settings, null, 2)) + console.info('Using local dev server settings (/config/local.json):') + console.info(JSON.stringify(settings, null, 2)) } catch (e) { - console.log('Local dev server settings not found (/config/local.json)') + console.info('Local dev server settings not found (/config/local.json)') } const target = settings.target || 'http://localhost:4000/' diff --git a/src/components/confirm_modal/mute_confirm.js b/src/components/confirm_modal/mute_confirm.js index 709296be8d7b489455576f1492deb2c708b594c4..1bef9f620b229c50e2280e7b8753535eb86ddf2e 100644 --- a/src/components/confirm_modal/mute_confirm.js +++ b/src/components/confirm_modal/mute_confirm.js @@ -61,9 +61,7 @@ export default { }, methods: { optionallyPrompt () { - console.log('Triggered') if (this.shouldConfirm) { - console.log('SHAWN!!') this.show() } else { this.doMute() diff --git a/src/components/emoji_picker/emoji_picker.js b/src/components/emoji_picker/emoji_picker.js index 8f6f1a0d061a64c11155a7fe315dfc55273a59ee..48532d3e7ec62a1daf8260c8c1ef02d9d72fa676 100644 --- a/src/components/emoji_picker/emoji_picker.js +++ b/src/components/emoji_picker/emoji_picker.js @@ -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 () { diff --git a/src/components/navigation/filter.js b/src/components/navigation/filter.js index 01ea7756f1f116f5d6d188ed8826a0e9dd984ff5..9b8f43cbadeb82c8441b0f3c920024b086c159fb 100644 --- a/src/components/navigation/filter.js +++ b/src/components/navigation/filter.js @@ -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] })) diff --git a/src/components/shadow_control/shadow_control.js b/src/components/shadow_control/shadow_control.js index 0657621dd8e98711d8ec88d116dd9375987e3eae..489351b69583e2062ff5c8fe84f30ddddc8bd7e0 100644 --- a/src/components/shadow_control/shadow_control.js +++ b/src/components/shadow_control/shadow_control.js @@ -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 = { diff --git a/src/components/status/status.js b/src/components/status/status.js index 7b9b92fad8c14edf7a12d56c55daca80693ce608..4f8ba31e45474a1cae96d1449740b9f0b4c968ba 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -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 diff --git a/src/i18n/compare b/src/i18n/compare index 4dc1e47dfb141905ad5f125ef03ba9f96f59cff9..94e5aab55585f983df625ac28aa189b06891921a 100755 --- a/src/i18n/compare +++ b/src/i18n/compare @@ -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) } diff --git a/src/modules/serverSideStorage.js b/src/modules/serverSideStorage.js index ed03bed7234d591c8ba71a824b220d48024374cd..8e56d6189b261a3a39ea2664bc8e86463bf8472f 100644 --- a/src/modules/serverSideStorage.js +++ b/src/modules/serverSideStorage.js @@ -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)) diff --git a/src/modules/statuses.js b/src/modules/statuses.js index e26d9cc3916375f47044f410d381d550ee427323..50507fa28c9c2bd8fc0598e718989b9e826e8e5b 100644 --- a/src/modules/statuses.js +++ b/src/modules/statuses.js @@ -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) } } diff --git a/src/services/color_convert/color_convert.js b/src/services/color_convert/color_convert.js index 9561c4a144e948da2ee968abd019062a863de200..0e78b57afde7dd66e72cefb95155c7096fffd57f 100644 --- a/src/services/color_convert/color_convert.js +++ b/src/services/color_convert/color_convert.js @@ -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] diff --git a/test/unit/specs/components/rich_content.spec.js b/test/unit/specs/components/rich_content.spec.js index 427eb5ed0e13dc7baec637830cdc7ff081d8e275..37d8bcbfaa3cae958fcf065a4cf4656fc8068b0f 100644 --- a/test/unit/specs/components/rich_content.spec.js +++ b/test/unit/specs/components/rich_content.spec.js @@ -539,7 +539,6 @@ describe('RichContent', () => { `, props: ['handleLinks', 'attentions', 'vhtml'] } - console.log(1) const ptest = (handleLinks, vhtml) => { const t0 = performance.now() @@ -562,11 +561,11 @@ describe('RichContent', () => { return `Mount: ${t1 - t0}ms, destroy: ${t2 - t1}ms, avg ${(t1 - t0) / amount}ms - ${(t2 - t1) / amount}ms per item` } - console.log(`${amount} items with links handling:`) - console.log(ptest(true)) - console.log(`${amount} items without links handling:`) - console.log(ptest(false)) - console.log(`${amount} items plain v-html:`) - console.log(ptest(false, true)) + console.debug(`${amount} items with links handling:`) + console.debug(ptest(true)) + console.debug(`${amount} items without links handling:`) + console.debug(ptest(false)) + console.debug(`${amount} items plain v-html:`) + console.debug(ptest(false, true)) }) }) diff --git a/test/unit/specs/services/theme_data/iss_deserializer.spec.js b/test/unit/specs/services/theme_data/iss_deserializer.spec.js index 6eb25dfe91396fa7eb61331381082742e4d30a27..ca97243f723efafb5f48a106b8f61efd6c04a4fd 100644 --- a/test/unit/specs/services/theme_data/iss_deserializer.spec.js +++ b/test/unit/specs/services/theme_data/iss_deserializer.spec.js @@ -21,17 +21,17 @@ describe('ISS (de)serialization', () => { const onlyComponent = componentsContext('./components/panel_header.style.js').default it.only(`(De)serialization of component ${onlyComponent.name} works`, () => { const normalized = onlyComponent.defaultRules.map(x => ({ component: onlyComponent.name, ...x })) - console.log('BEGIN INPUT ================') - console.log(normalized) - console.log('END INPUT ==================') + console.debug('BEGIN INPUT ================') + console.debug(normalized) + console.debug('END INPUT ==================') const serialized = serialize(normalized) - console.log('BEGIN SERIAL ===============') - console.log(serialized) - console.log('END SERIAL =================') + console.debug('BEGIN SERIAL ===============') + console.debug(serialized) + console.debug('END SERIAL =================') const deserialized = deserialize(serialized) - console.log('BEGIN DESERIALIZED =========') - console.log(serialized) - console.log('END DESERIALIZED ===========') + console.debug('BEGIN DESERIALIZED =========') + console.debug(serialized) + console.debug('END DESERIALIZED ===========') // for some reason comparing objects directly fails the assert expect(JSON.stringify(deserialized, null, 2)).to.equal(JSON.stringify(normalized, null, 2)) diff --git a/tools/emoji_merger.js b/tools/emoji_merger.js index a74e847edf2da28f8cea7e1fc3aec211886cb816..78a798dfe374a71388936e69e65e7e550e1f8324 100644 --- a/tools/emoji_merger.js +++ b/tools/emoji_merger.js @@ -60,7 +60,7 @@ const run = () => { }, {}) fs.writeFile(outputFilename, JSON.stringify(sorted, null, 2), 'utf8', (err) => { - if (err) console.log('Error writing file', err) + if (err) console.error('Error writing file', err) }) }