Skip to content

Commit

Permalink
Update example
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkGriffiths committed Feb 15, 2019
1 parent 96f6388 commit 49e144d
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions src/docs/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,23 @@ npm install --save verbosity
Simply override the built in console object:

```javascript
const console = require('../../index.js').createConsole({
outStream: process.stdout,
errorStream: process.stderr,
verbosity: 5
import {createConsole} from 'verbosity'

const console = createConsole({
outStream: process.stdout,
errorStream: process.stderr,
verbosity: 5
})
```

This will direct all console output to stderr, but silence 'info' and 'debug' messages.

```javascript
const console = require('../../index.js').createConsole({
outStream: process.stderr,
verbosity: 3
import {createConsole} from 'verbosity'

const console = createConsole({
outStream: process.stderr,
verbosity: 3
})

console.log('Picked brown jacket...') // Printed
Expand All @@ -32,9 +36,11 @@ console.warn("That tie doesn't go with that jacket.") // Printed
Or go mad with making up any number of custom console writers.

```javascript
const myUberConsole = require('../../index.js').createConsole({
outStream: myFancyWriteableStream,
verbosity: 5
import {createConsole} from 'verbosity'

const myUberConsole = createConsole({
outStream: myFancyWriteableStream,
verbosity: 5
})

myUberConsole.panic('Core Flux Capacitor Meltdown!')
Expand Down

0 comments on commit 49e144d

Please sign in to comment.