From 7a750bf96d1d2e64b473f893d4ed84d3644f3b92 Mon Sep 17 00:00:00 2001 From: Clark Du Date: Wed, 23 May 2018 15:05:16 +0100 Subject: [PATCH] feat: support custom additional style (#18) --- README.md | 1 + examples/basic.js | 2 +- src/reporters/fancy.js | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f7adbebd..c7237d99 100644 --- a/README.md +++ b/README.md @@ -158,6 +158,7 @@ Extended fields: - `clear` - `badge` - `additional` +- `additionalStyle` (By default: `grey`) ## Integrations diff --git a/examples/basic.js b/examples/basic.js index 6a42e531..6dabdd72 100644 --- a/examples/basic.js +++ b/examples/basic.js @@ -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') diff --git a/src/reporters/fancy.js b/src/reporters/fancy.js index 66f4c6a4..995ffc3c 100644 --- a/src/reporters/fancy.js +++ b/src/reporters/fancy.js @@ -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') } } }