Skip to content

Commit

Permalink
feat: support custom additional style (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
clarkdo authored and pi0 committed May 23, 2018
1 parent 91be791 commit 7a750bf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ Extended fields:
- `clear`
- `badge`
- `additional`
- `additionalStyle` (By default: `grey`)

## Integrations

Expand Down
2 changes: 1 addition & 1 deletion examples/basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ consola.start('Starting build')

consola.warn('Something is going to happen soon')

consola.log('Bla', 'Bla', 'Bla', 'Bla')
consola.withDefaults({additionalStyle: 'underline'}).log('Bla', 'Bla', 'Bla', 'Bla')

setTimeout(() => {
consola.success('Build succeed in 10 seconds')
Expand Down
2 changes: 1 addition & 1 deletion src/reporters/fancy.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default class FancyReporter {

if (logObj.additional) {
const lines = logObj.additional.split('\n').map(s => ' ' + s).join('\n')
this.stream.write(chalk.grey(lines) + '\n')
this.stream.write(chalk[logObj.additionalStyle || 'grey'](lines) + '\n')
}
}
}

0 comments on commit 7a750bf

Please sign in to comment.