Skip to content

Commit fe63e16

Browse files
committed
Add figures to code
1 parent b7bd334 commit fe63e16

File tree

1 file changed

+7
-22
lines changed

1 file changed

+7
-22
lines changed

src/level.js

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
'use strict'
22

3-
const {
4-
platform,
5-
env: { TERM },
6-
emitWarning,
7-
} = require('process')
3+
const { emitWarning } = require('process')
4+
5+
const { circleFilled, info: infoSym, warning, cross } = require('figures')
86

97
// Retrieve error's `level`
108
const getLevel = function({ opts, info }) {
@@ -20,25 +18,12 @@ const getLevel = function({ opts, info }) {
2018
return defaultGetLevel(info)
2119
}
2220

23-
const supportsUnicode = platform !== 'win32' || TERM === 'xterm-256color'
2421
// Each level is printed in a different way
2522
const LEVELS = {
26-
debug: {
27-
COLOR: 'blue',
28-
SIGN: supportsUnicode ? '\u25C9' : '(*)',
29-
},
30-
info: {
31-
COLOR: 'green',
32-
SIGN: supportsUnicode ? '\u2139' : 'i',
33-
},
34-
warn: {
35-
COLOR: 'yellow',
36-
SIGN: supportsUnicode ? '\u26A0' : '\u203C',
37-
},
38-
error: {
39-
COLOR: 'red',
40-
SIGN: supportsUnicode ? '\u2716' : '\u00D7',
41-
},
23+
debug: { COLOR: 'blue', SIGN: circleFilled },
24+
info: { COLOR: 'green', SIGN: infoSym },
25+
warn: { COLOR: 'yellow', SIGN: warning },
26+
error: { COLOR: 'red', SIGN: cross },
4227
}
4328

4429
// Default `opts.getLevel()`

0 commit comments

Comments
 (0)