2021-12-13 22:37:43 +01:00
/* eslint no-console: ["error", { allow: ["log", "info", "warn"] }] */
2021-07-31 19:53:12 +02:00
2021-09-12 15:58:56 +02:00
/* Prints the app name and version, helpful for debugging */
2021-07-31 19:53:12 +02:00
export const welcomeMsg = ( ) => {
const v = process . env . VUE _APP _VERSION ? ` V ${ process . env . VUE _APP _VERSION } ` : '' ;
2021-09-09 20:09:40 +02:00
console . log ( ` \n %cDashy ${ v } 🚀 ` , 'color:#0dd8d8; background:#0b1021; font-size:1.5rem; padding:0.15rem 0.25rem; margin: 1rem auto; font-family: Rockwell; border: 2px solid #0dd8d8; border-radius: 4px;font-weight: bold; text-shadow: 1px 1px 1px #00af87bf;' ) ;
2021-07-31 19:53:12 +02:00
} ;
2021-09-12 15:58:56 +02:00
/* Prints warning message, usually when there is a configuration error */
2021-12-13 22:37:43 +01:00
export const warningMsg = ( message , stack ) => {
2021-09-05 00:09:21 +02:00
console . info (
2024-02-27 21:16:14 +01:00
` \n %c⚠️ Warning ⚠️%c \n ${ message } \n \n %cThis is likely not an issue with Dashy, but rather your configuration. \n If you think it is a bug, please open a ticket on GitHub: https://git.io/JukXk ` ,
2021-09-09 20:09:40 +02:00
"color:#ceb73f; background: #ceb73f33; font-size:1.5rem; padding:0.15rem; margin: 1rem auto; font-family: Rockwell, Tahoma, 'Trebuchet MS', Helvetica; border: 2px solid #ceb73f; border-radius: 4px; font-weight: bold; text-shadow: 1px 1px 1px #000000bf;" ,
'font-weight: bold; font-size: 1rem;color: #ceb73f;' ,
"color: #ceb73f; font-size: 0.75rem; font-family: Tahoma, 'Trebuchet MS', Helvetica;" ,
2021-09-05 00:09:21 +02:00
) ;
2021-12-13 22:37:43 +01:00
if ( stack ) {
console . warn ( ` %cStack Trace%c \n ${ stack } ` , 'font-weight: bold;' , '' ) ;
}
2021-07-31 19:53:12 +02:00
} ;
2021-09-12 15:58:56 +02:00
/* Prints status message */
export const statusMsg = ( title , msg ) => {
console . log (
` %c ${ title || '' } \n %c ${ msg } ` ,
'font-weight: bold; color: #0dd8d8; text-decoration: underline;' ,
'color: #ceb73f;' ,
) ;
} ;
/* Prints status message, with a stack trace */
export const statusErrorMsg = ( title , msg , errorLog ) => {
console . log (
2021-09-19 22:28:05 +02:00
` %c ${ title || '' } \n %c ${ msg } \n %c ${ errorLog || '' } ` ,
2021-09-12 15:58:56 +02:00
'font-weight: bold; color: #0dd8d8; text-decoration: underline;' ,
'color: #ff025a' ,
'color: #ff025a80;' ,
) ;
2021-07-31 19:53:12 +02:00
} ;