File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,14 @@ class ConfigClass {
1212 info : this . validateEmoji ( logSymbols ?. info ) || "ℹ️" ,
1313 log : this . validateEmoji ( logSymbols ?. log ) || "📄" ,
1414 } ,
15+ logColors : {
16+ success : "\x1b[32m" ,
17+ fail : "\x1b[31m" ,
18+ warn : "\x1b[33m" ,
19+ error : "\x1b[31m" ,
20+ info : "\x1b[36m" ,
21+ log : "\x1b[37m" ,
22+ } ,
1523 } ;
1624 }
1725
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ const createLogger = (params) => {
66 const config = configInstance . getConfig ( ) ;
77
88 const logSymbols = config . logSymbols ;
9+ const logColors = config . logColors ;
910
1011 const log = ( level , ...args ) => {
1112 const logFunction = {
@@ -21,7 +22,7 @@ const createLogger = (params) => {
2122 const isLoggingDisabled = config ?. isLoggingDisabled ;
2223
2324 if ( isLoggingDisabled ) return ;
24- logFunction [ level ] ( `${ timestamp } ${ logSymbols [ level ] } ${ config ?. disablePrefixText ? "" : level . charAt ( 0 ) . toUpperCase ( ) + level . slice ( 1 ) + ": " } ` , ...args ) ;
25+ logFunction [ level ] ( `${ logColors [ level ] } ${ timestamp } ${ logSymbols [ level ] } ${ config ?. disablePrefixText ? "" : level . charAt ( 0 ) . toUpperCase ( ) + level . slice ( 1 ) + ": " } ` , ...args ) ;
2526 } ;
2627
2728 return {
You can’t perform that action at this time.
0 commit comments