diff --git a/src/App.vue b/src/App.vue index ed138ca0a..b5be4ec86 100644 --- a/src/App.vue +++ b/src/App.vue @@ -46,7 +46,7 @@ window.onerror = (msg, url, line, col, error) => { column: col ?? "", error: error ?? "", }); - + // If you return true, then error alerts (like in older versions of // Internet Explorer) will be suppressed. var suppressErrorAlert = true; diff --git a/src/constants/application-config.js b/src/constants/application-config.js index 1b4385fe2..6c4ecd387 100644 --- a/src/constants/application-config.js +++ b/src/constants/application-config.js @@ -28,8 +28,7 @@ const applicationConfig = { YAHOO_CALENDAR: "https://calendar.yahoo.com/?v=60", OUTLOOK_CALENDAR: "https://outlook.office.com/calendar/deeplink/compose?path=/calendar/action/compose&rru=addevent", - FRONTEND_LOGGER_URL: - process.env.VUE_APP_CONSUMER_CF_DISTRO + "/analytics/api/v1/logging" + FRONTEND_LOGGER_URL: process.env.VUE_APP_CONSUMER_CF_DISTRO + "/analytics/api/v1/logging", }; export { applicationConfig }; diff --git a/src/global-methods.js b/src/global-methods.js index c018740ef..f249f5740 100644 --- a/src/global-methods.js +++ b/src/global-methods.js @@ -100,7 +100,7 @@ export default { } global.$logger.logError(`${method}: ${endpoint}: ${error.message}`, error); - + return reject(error); } ); diff --git a/src/helpers/logger.js b/src/helpers/logger.js index 0b3492856..7e2a3d7c1 100644 --- a/src/helpers/logger.js +++ b/src/helpers/logger.js @@ -7,11 +7,17 @@ import { headerKeys } from "@/constants/header-keys"; export class Logger { logInformation(message, details) { - this.writeLogEntry(loggingEndpointMethods.LOG_INFORMATION, this.formatLogEntry(message, details)); + this.writeLogEntry( + loggingEndpointMethods.LOG_INFORMATION, + this.formatLogEntry(message, details) + ); } logWarning(message, details) { - this.writeLogEntry(loggingEndpointMethods.LOG_WARNING, this.formatLogEntry(message, details)); + this.writeLogEntry( + loggingEndpointMethods.LOG_WARNING, + this.formatLogEntry(message, details) + ); } logError(message, details) { @@ -19,17 +25,25 @@ export class Logger { } logCritical(message, details) { - this.writeLogEntry(loggingEndpointMethods.LOG_CRITICAL, this.formatLogEntry(message, details)); + this.writeLogEntry( + loggingEndpointMethods.LOG_CRITICAL, + this.formatLogEntry(message, details) + ); } formatLogEntry(message, details) { - return `Application: ${applicationConfig.APPLICATION_NAME}\n${message}\n${details ? JSON.stringify(details, undefined, 2) : ""}`; + return `Application: ${applicationConfig.APPLICATION_NAME}\n${message}\n${ + details ? JSON.stringify(details, undefined, 2) : "" + }`; } writeLogEntry(endpoint, logEntry) { return new Promise((resolve, reject) => { // If running locally or in the Dev environment show the log entries in the console. - if (applicationConfig.CURRENT_ENVIRONMENT === "Localhost" || applicationConfig.CURRENT_ENVIRONMENT === "Dev") { + if ( + applicationConfig.CURRENT_ENVIRONMENT === "Localhost" || + applicationConfig.CURRENT_ENVIRONMENT === "Dev" + ) { console.log(logEntry); } diff --git a/src/main.js b/src/main.js index 7fa7c1130..d65165398 100644 --- a/src/main.js +++ b/src/main.js @@ -26,7 +26,9 @@ vueApp.mixin(experimentMixin); // Vue Error Handling vueApp.config.errorHandler = (err, vm, info) => { - global.$logger.logError(`Page Name - ${vm.getPageName()} - ${info}: ${err.message}\n${err.stack}`); + global.$logger.logError( + `Page Name - ${vm.getPageName()} - ${info}: ${err.message}\n${err.stack}` + ); }; vueApp.mount("#app"); diff --git a/src/store/index.js b/src/store/index.js index 1c371f3a5..20b84af21 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1126,11 +1126,9 @@ export const actions = { payload: payload, logApiCall: false, }) - .then( - (response) => { - return response; - } - ); + .then((response) => { + return response; + }); }, logCustomEvent( @@ -1177,11 +1175,9 @@ export const actions = { payload: payload, logApiCall: false, }) - .then( - (response) => { - return response; - } - ); + .then((response) => { + return response; + }); }, initializeSession(context, { userId, deviceId, sessionId, userAgent, referrer }) { var payload = { @@ -1202,11 +1198,9 @@ export const actions = { payload: payload, logApiCall: false, }) - .then( - (response) => { - return response; - } - ); + .then((response) => { + return response; + }); }, // Misc Actions