Prettified
This commit is contained in:
parent
9b7d2c8e81
commit
dae9620843
6 changed files with 34 additions and 25 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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 };
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ export default {
|
|||
}
|
||||
|
||||
global.$logger.logError(`${method}: ${endpoint}: ${error.message}`, error);
|
||||
|
||||
|
||||
return reject(error);
|
||||
}
|
||||
);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue