Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use new logging framework consistently #1459

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/AppMain.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ 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))
this.$log.debug(this.$window.isSameBaseRoute(from.fullPath, to.fullPath))
},
*/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines are commented out. After it is redirected to a debug-level logger, we could remove the comment and just let the logger ignore the logged data in the normal (non-debug) case. Am I right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. Sounds like a plan.

},
Expand Down
3 changes: 1 addition & 2 deletions src/components/AppNavi.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
}`
Expand Down
12 changes: 4 additions & 8 deletions src/components/RecipeEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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", {
Expand Down
15 changes: 6 additions & 9 deletions src/components/RecipeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ export default {
}

if (this.$store.state.recipe === null) {
// console.log("Recipe is null")
this.$log.debug("Recipe is null")
return recipe
}

Expand Down Expand Up @@ -452,9 +452,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…")
Expand All @@ -475,8 +475,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 {
Expand All @@ -493,8 +492,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 {
Expand All @@ -511,8 +509,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 {
Expand Down
6 changes: 2 additions & 4 deletions src/components/SettingsDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,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
) {
Expand All @@ -265,8 +264,7 @@ export default {
})
.catch(() => {
$this.scanningLibrary = false
// eslint-disable-next-line no-console
console.log("Library reindexing failed!")
this.$log.error("Library reindexing failed!")
})
},

Expand Down