Last active
January 6, 2024 18:35
-
-
Save laocoi/0dd2e5ca1af0558b685ffefacafee126 to your computer and use it in GitHub Desktop.
Revisions
-
laocoi revised this gist
Jan 6, 2024 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,13 @@ function colorLog(text, type, getStr = false){ let str; switch (type) { case 'e': // error str = '\u001b[38;2;255;0;0m'+text+'\u001b[0m' break; case 's': // success str = '\u001b[38;2;0;255;0m'+text+'\u001b[0m' break; case 'w': // warning str = '\u001b[38;2;255;140;0m'+text+'\u001b[0m' break; case 'bold': @@ -17,7 +17,7 @@ function colorLog(text, type, getStr = false){ str = '\u001b[4m'+text+'\u001b[0m' break; default: str = text break; } return getStr ? str : console.log(str) -
laocoi renamed this gist
Jan 6, 2024 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
laocoi created this gist
Jan 6, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ function colorLog(text, type, getStr = false){ let str; switch (type) { case 'e': str = '\u001b[38;2;255;0;0m'+text+'\u001b[0m' break; case 's': str = '\u001b[38;2;0;255;0m'+text+'\u001b[0m' break; case 'w': str = '\u001b[38;2;255;140;0m'+text+'\u001b[0m' break; case 'bold': str = '\u001b[1m'+text+'\u001b[0m' break; case 'underlined': str = '\u001b[4m'+text+'\u001b[0m' break; default: break; } return getStr ? str : console.log(str) }