Merge pull request #1459 from MarcelRobitaille/proliferate-use-of-logging-framework

Use new logging framework consistently
This commit is contained in:
Christian Wolf 2023-03-24 14:08:21 +01:00 коммит произвёл GitHub
Родитель 8a95b5d606 1f3b8592b1
Коммит 0f695b29c6
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
9 изменённых файлов: 21 добавлений и 39 удалений

Просмотреть файл

@ -25,6 +25,8 @@
[#1440](https://github.com/nextcloud/cookbook/pull/1440) @christianlupus
- Fix the build environment after regression
[#1442](https://github.com/nextcloud/cookbook/pull/1442) @christianlupus
- Use logging framework throughout the complete app
[1459](https://github.com/nextcloud/cookbook/pull/1459) @MarcelRobitaille
## Documentation
- Fixed some issues in the API description #1419 and #1461 @leptopoda

Просмотреть файл

@ -46,11 +46,11 @@ export default {
}
},
watch: {
/* This is left here as an example in case the routes need to be debugged again
'$route' (to, from) {
console.log(this.$window.isSameBaseRoute(from.fullPath, to.fullPath))
$route(to, from) {
this.$log.debug(
this.$window.isSameBaseRoute(from.fullPath, to.fullPath)
)
},
*/
},
mounted() {
this.$log.info("AppMain mounted")

Просмотреть файл

@ -324,8 +324,7 @@ export default {
continue
}
if ($this.$refs[`app-navi-cat-${i}`][0].opened) {
// eslint-disable-next-line no-console
console.log(
this.$log.info(
`Reloading recipes in ${
$this.$refs[`app-navi-cat-${i}`][0].title
}`

Просмотреть файл

@ -437,8 +437,7 @@ export default {
$this.allRecipes = response.data
})
.catch((e) => {
// eslint-disable-next-line no-console
console.log(e)
this.$log.error(e)
})
.then(() => {
// finally
@ -602,22 +601,19 @@ export default {
// prettier-ignore
t("cookbook","Unknown answer returned from server. See logs.")
)
// eslint-disable-next-line no-console
console.log(e.response)
this.$log.error(e.response)
}
} else if (e.request) {
await showSimpleAlertModal(
t("cookbook", "No answer for request was received.")
)
// eslint-disable-next-line no-console
console.log(e)
this.$log.error(e)
} else {
await showSimpleAlertModal(
// prettier-ignore
t("cookbook","Could not start request to save recipe.")
)
// eslint-disable-next-line no-console
console.log(e)
this.$log.error(e)
}
} finally {
$this.$store.dispatch("setSavingRecipe", {

Просмотреть файл

@ -330,7 +330,7 @@ export default {
}
if (this.$store.state.recipe === null) {
// console.log("Recipe is null")
this.$log.debug("Recipe is null")
return recipe
}
@ -464,9 +464,9 @@ export default {
},
watch: {
recipe(r) {
// console.log('Recipe has been updated')
this.$log.debug("Recipe has been updated")
if (r) {
// console.log("Recipe", r)
this.$log.debug("Recipe", r)
if (r.description) {
this.parsedDescription = t("cookbook", "Loading…")
@ -487,8 +487,7 @@ export default {
this.parsedIngredients.splice(idx, 1, x)
})
.catch((ex) => {
// eslint-disable-next-line no-console
console.log(ex)
this.$log.error(ex)
})
})
} else {
@ -505,8 +504,7 @@ export default {
this.parsedInstructions.splice(idx, 1, x)
})
.catch((ex) => {
// eslint-disable-next-line no-console
console.log(ex)
this.$log.error(ex)
})
})
} else {
@ -523,8 +521,7 @@ export default {
this.parsedTools.splice(idx, 1, x)
})
.catch((ex) => {
// eslint-disable-next-line no-console
console.log(ex)
this.$log.error(ex)
})
})
} else {

Просмотреть файл

@ -375,8 +375,7 @@ export default {
.reindex()
.then(() => {
$this.scanningLibrary = false
// eslint-disable-next-line no-console
console.log("Library reindexing complete")
this.$log.info("Library reindexing complete")
if (
["index", "search"].indexOf(this.$store.state.page) > -1
) {
@ -388,8 +387,7 @@ export default {
})
.catch(() => {
$this.scanningLibrary = false
// eslint-disable-next-line no-console
console.log("Library reindexing failed!")
this.$log.error("Library reindexing failed!")
})
},

Просмотреть файл

@ -211,10 +211,7 @@ export const suggestionsPopupMixin = {
* Recover suggestions popup on focus
*/
handleSuggestionsPopupFocus(e) {
if (this.verboseDebugLogging) {
// eslint-disable-next-line no-console
console.log("focus", e, JSON.stringify(this.suggestionsData))
}
this.$log.debug("focus", e, JSON.stringify(this.suggestionsData))
if (this.suggestionsData?.blurred) {
this.suggestionsData.blurred = false
}
@ -223,10 +220,7 @@ export const suggestionsPopupMixin = {
* Cancel selection if input gets blurred
*/
handleSuggestionsPopupBlur(e) {
if (this.verboseDebugLogging) {
// eslint-disable-next-line no-console
console.log("blur", e, JSON.stringify(this.suggestionsData))
}
this.$log.debug("blur", e, JSON.stringify(this.suggestionsData))
if (!this.suggestionsPopupVisible || !this.$refs.suggestionsPopup) {
return
}

Просмотреть файл

@ -40,9 +40,6 @@ window.escapeHTML = helpers.escapeHTML
Vue.prototype.$window = window
Vue.prototype.OC = OC
// eslint-disable-next-line no-undef
Vue.prototype.verboseDebugLogging = verboseDebugLogging
// Markdown for Vue
Vue.use(VueShowdown, {
// set default flavor for Markdown

Просмотреть файл

@ -28,7 +28,6 @@ function cookbookConfig (env) {
new CleanWebpackPlugin(),
new webpack.DefinePlugin({
'__webpack_use_dev_server__': env.dev_server || false,
'verboseDebugLogging': isDev && (process.env.VERBOSE || false),
}),
],
resolve: {