@@ -9,19 +9,23 @@ npm install --save verbosity
9
9
Simply override the built in console object:
10
10
11
11
``` javascript
12
- const console = require (' ../../index.js' ).createConsole ({
13
- outStream: process .stdout ,
14
- errorStream: process .stderr ,
15
- verbosity: 5
12
+ import {createConsole } from ' verbosity'
13
+
14
+ const console = createConsole ({
15
+ outStream: process .stdout ,
16
+ errorStream: process .stderr ,
17
+ verbosity: 5
16
18
})
17
19
```
18
20
19
21
This will direct all console output to stderr, but silence 'info' and 'debug' messages.
20
22
21
23
``` javascript
22
- const console = require (' ../../index.js' ).createConsole ({
23
- outStream: process .stderr ,
24
- verbosity: 3
24
+ import {createConsole } from ' verbosity'
25
+
26
+ const console = createConsole ({
27
+ outStream: process .stderr ,
28
+ verbosity: 3
25
29
})
26
30
27
31
console .log (' Picked brown jacket...' ) // Printed
@@ -32,9 +36,11 @@ console.warn("That tie doesn't go with that jacket.") // Printed
32
36
Or go mad with making up any number of custom console writers.
33
37
34
38
``` javascript
35
- const myUberConsole = require (' ../../index.js' ).createConsole ({
36
- outStream: myFancyWriteableStream,
37
- verbosity: 5
39
+ import {createConsole } from ' verbosity'
40
+
41
+ const myUberConsole = createConsole ({
42
+ outStream: myFancyWriteableStream,
43
+ verbosity: 5
38
44
})
39
45
40
46
myUberConsole .panic (' Core Flux Capacitor Meltdown!' )
0 commit comments