1
0
Fork 0

chore(plugins): Migrate from log.warning to log.warn

This commit is contained in:
joostdecock 2023-09-06 08:29:59 +02:00
parent 9ae94abd02
commit 9f081eebb1
3 changed files with 4 additions and 4 deletions

View file

@ -42,7 +42,7 @@ function addCut(store, so = {}) {
return store
}
if (typeof material !== 'string') {
store.log.warning(`Tried to set material to a value that is not a string`)
store.log.warn(`Tried to set material to a value that is not a string`)
return store
}
const path = ['cutlist', partName, 'materials', material]

View file

@ -10,10 +10,10 @@ export const plugin = {
else {
const msg =
"No translation method or object was passed to the i18n plugin. This plugin won't do anything without that"
if (pattern?.store?.log?.warning) {
if (pattern?.store?.log?.warn) {
if (!pattern.store.get(['plugins', 'plugin-i18n', 'missingMethodWarning'])) {
pattern.store.set(['plugins', 'plugin-i18n', 'missingMethodWarning'], true)
pattern.store.log.warning(msg)
pattern.store.log.warn(msg)
}
} else console.log(msg)

View file

@ -22,7 +22,7 @@ const mirrorGen = (start, end) => {
const mirrorCount = Number(point.attributes.get('data-mirrored'))
// some points returned by utils do not have logs
if (mirrorCount > 0 && point.log)
point.log.warning(
point.log.warn(
`Point ${point.name} was mirrored more than once (${
mirrorCount + 1
}) which can lead to hard to trace bugs`