Skip to content

Commit 63fbede

Browse files
committed
fix(logs): Change to logLevel instead of debug
1 parent 2804d80 commit 63fbede

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

core/lib/patternlab.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class PatternLab {
5050
this.config = config || fs.readJSONSync(path.resolve(__dirname, '../../patternlab-config.json'));
5151

5252
//register our log events
53-
this.registerLogger(config.debug);
53+
this.registerLogger(config.logLevel);
5454

5555
logger.info(`Pattern Lab Node v${packageInfo.version}`);
5656

@@ -246,18 +246,14 @@ class PatternLab {
246246
outputFiles.forEach(outFile => fs.outputFileSync(outFile.path, outFile.content));
247247
}
248248

249-
250-
251249
/**
252250
* Binds console logging to different levels
253251
*
254252
* @param {string} logLevel
255253
* @memberof PatternLab
256254
*/
257255
registerLogger(logLevel) {
258-
259-
// handle the legacy value, which is boolean
260-
if (typeof logLevel === 'boolean') {
256+
if (logLevel === undefined) {
261257
if (logLevel) {
262258
logger.log.on('debug', msg => console.info(msg));
263259
}
@@ -377,8 +373,8 @@ function checkConfiguration(patternlab) {
377373

378374
if (typeof patternlab.config.debug === 'boolean') {
379375
logger.warning('');
380-
logger.warning(`Configuration key [debug] inside patternlab-config.json was found as a boolean. As of Pattern Lab Node Core 3.0.0 this key is a string with possible values ['debug', 'info', 'warning', 'error', 'quiet'].`);
381-
logger.warning(`Turning on 'info', 'warning', and 'error' levels by default`);
376+
logger.warning(`Configuration key [debug] inside patternlab-config.json was found. As of Pattern Lab Node Core 3.0.0 this key is replaced with a new key, [logLevel]. This is a string with possible values ['debug', 'info', 'warning', 'error', 'quiet'].`);
377+
logger.warning(`Turning on 'info', 'warning', and 'error' levels by default, unless [logLevel] is present. If that is the case, [debug] has no effect.`);
382378
logger.warning('');
383379
}
384380

0 commit comments

Comments
 (0)