File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,11 @@ import { writeStream } from '../utils/stream'
4
4
import { formatDate } from '../utils/date'
5
5
6
6
const DEFAULTS = {
7
- dateFormat : 'HH:mm:ss'
7
+ dateFormat : 'HH:mm:ss' ,
8
+ formatOptions : {
9
+ colors : false ,
10
+ compact : true
11
+ }
8
12
}
9
13
10
14
const bracket = x => x ? `[${ x } ]` : ''
@@ -26,8 +30,10 @@ export default class BasicReporter {
26
30
return arg
27
31
} )
28
32
33
+ // Only supportet with Node >= 10
34
+ // https://nodejs.org/api/util.html#util_util_inspect_object_options
29
35
if ( typeof util . formatWithOptions === 'function' ) {
30
- return util . formatWithOptions ( { colors : true } , ..._args ) // Node >= 10
36
+ return util . formatWithOptions ( this . options . formatOptions , ..._args )
31
37
} else {
32
38
return util . format ( ..._args )
33
39
}
Original file line number Diff line number Diff line change @@ -6,7 +6,11 @@ import { chalkColor, chalkBgColor } from '../utils/chalk'
6
6
import { TYPE_COLOR_MAP , LEVEL_COLOR_MAP } from '../utils/fancy'
7
7
8
8
const DEFAULTS = {
9
- secondaryColor : 'grey'
9
+ secondaryColor : 'grey' ,
10
+ formatOptions : {
11
+ colors : true ,
12
+ compact : false
13
+ }
10
14
}
11
15
12
16
const TYPE_ICONS = {
You can’t perform that action at this time.
0 commit comments