🚸 Adds user-facing warning logging

This commit is contained in:
Alicia Sykes 2021-09-19 21:28:05 +01:00
parent 0927ea879b
commit 6e0cda8709
2 changed files with 7 additions and 2 deletions

View File

@ -28,7 +28,7 @@ export const statusMsg = (title, msg) => {
/* Prints status message, with a stack trace */
export const statusErrorMsg = (title, msg, errorLog) => {
console.log(
`%c${title || ''}\n%c${msg} \n%c${errorLog}`,
`%c${title || ''}\n%c${msg} \n%c${errorLog || ''}`,
'font-weight: bold; color: #0dd8d8; text-decoration: underline;',
'color: #ff025a',
'color: #ff025a80;',

View File

@ -1,5 +1,5 @@
import * as Sentry from '@sentry/vue';
import { warningMsg, statusMsg } from '@/utils/CoolConsole';
import { warningMsg, statusMsg, statusErrorMsg } from '@/utils/CoolConsole';
import { sessionStorageKeys } from '@/utils/defaults';
/* Makes the current time, like hh:mm:ss */
@ -33,4 +33,9 @@ export const InfoHandler = (msg, title) => {
statusMsg(title || 'Info', msg);
};
/* Outputs warnings caused by the user, such as missing field */
export const WarningInfoHandler = (msg, title, log) => {
statusErrorMsg(title || 'Warning', msg, log);
};
export default ErrorHandler;