File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change 11'use strict'
22
3- const { platform } = require ( 'process' )
3+ const {
4+ platform,
5+ env : { TERM } ,
6+ } = require ( 'process' )
47
58// Retrieve error's `level`
69const getLevel = function ( { opts, info } ) {
@@ -15,16 +18,24 @@ const getLevel = function({ opts, info }) {
1518 return level
1619}
1720
18- const isWindows = platform === 'win32'
21+ const supportsUnicode = platform !== 'win32' || TERM === 'xterm-256color '
1922// Each level is printed in a different way
2023const LEVELS = {
24+ debug : {
25+ COLOR : 'blue' ,
26+ SIGN : supportsUnicode ? '\u2699' : '!' ,
27+ } ,
28+ info : {
29+ COLOR : 'green' ,
30+ SIGN : supportsUnicode ? '\u2139' : 'i' ,
31+ } ,
2132 warn : {
2233 COLOR : 'yellow' ,
23- SIGN : isWindows ? '\u203C ' : '\u26A0 ' ,
34+ SIGN : supportsUnicode ? '\u26A0 ' : '\u203C ' ,
2435 } ,
2536 error : {
2637 COLOR : 'red' ,
27- SIGN : isWindows ? '\u00D7 ' : '\u2718 ' ,
38+ SIGN : supportsUnicode ? '\u2718 ' : '\u00D7 ' ,
2839 } ,
2940}
3041
You can’t perform that action at this time.
0 commit comments