diff --git a/package-lock.json b/package-lock.json index eecec00fa..a7bd6d351 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,6 +27,7 @@ "mitt": "^2.1.0", "register-service-worker": "^1.7.1", "vue": "^3.2.26", + "vue-logger-plugin": "^2.2.3", "vue-router": "^4.0.12", "vuex": "^4.0.1", "vuex-persistedstate": "^4.0.0-beta.3" @@ -16384,6 +16385,11 @@ "node": ">=8" } }, + "node_modules/vue-logger-plugin": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/vue-logger-plugin/-/vue-logger-plugin-2.2.3.tgz", + "integrity": "sha512-PGGwFarWpReyJc8XONuNBb86mpfLqYO6+MWjkFnCDWcagjM2BLY7rskLTgn3eT3skq0qu+2K2roiIAgiXJDXSQ==" + }, "node_modules/vue-router": { "version": "4.2.5", "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.2.5.tgz", diff --git a/package.json b/package.json index db6f95d76..b1be7a2f8 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ "mitt": "^2.1.0", "register-service-worker": "^1.7.1", "vue": "^3.2.26", + "vue-logger-plugin": "^2.2.3", "vue-router": "^4.0.12", "vuex": "^4.0.1", "vuex-persistedstate": "^4.0.0-beta.3" diff --git a/src/App.vue b/src/App.vue index 82a3580cc..fbd764067 100644 --- a/src/App.vue +++ b/src/App.vue @@ -13,6 +13,7 @@ import { mapGetters, useStore } from 'vuex'; import { initialise, resetConfig } from '@/adapter' import { useRouter } from 'vue-router'; import { translate, useProductIdentificationStore } from "@hotwax/dxp-components"; +import logger from '@/logger' export default defineComponent({ name: 'App', @@ -95,7 +96,7 @@ export default defineComponent({ if(this.userToken) { // Get product identification from api using dxp-component await useProductIdentificationStore().getIdentificationPref(this.currentEComStore?.productStoreId) - .catch((error) => console.error(error)); + .catch((error) => logger.error(error)); } }, unmounted() { diff --git a/src/components/EditPickerModal.vue b/src/components/EditPickerModal.vue index 2fae065f8..19d05b90f 100644 --- a/src/components/EditPickerModal.vue +++ b/src/components/EditPickerModal.vue @@ -67,6 +67,7 @@ import { hasError } from '@/adapter' import { translate } from '@hotwax/dxp-components' import { UtilService } from "@/services/UtilService"; import { PicklistService } from "@/services/PicklistService"; +import logger from "@/logger"; export default defineComponent({ name: "EditPickersModal", @@ -151,7 +152,7 @@ export default defineComponent({ throw resp.data } } catch (err) { - console.error('Failed to fetch the pickers information or there are no pickers available', err) + logger.error('Failed to fetch the pickers information or there are no pickers available', err) } }, async confirmSave() { @@ -191,7 +192,7 @@ export default defineComponent({ } } catch (err) { showToast(translate('Something went wrong, could not edit picker.')) - console.error('Something went wrong, could not edit picker') + logger.error('Something went wrong, could not edit picker') } }, closeModal() { diff --git a/src/components/Image.vue b/src/components/Image.vue index 936939ea9..ca8ff499b 100644 --- a/src/components/Image.vue +++ b/src/components/Image.vue @@ -4,6 +4,7 @@