Log when using non-valid log_level. #2706

This commit is contained in:
Koen Kanters
2020-01-16 23:33:17 +01:00
parent 3f6a95bc0b
commit 39ed95371e
+3
View File
@@ -6,6 +6,7 @@ const fs = require('fs');
const fx = require('mkdir-recursive');
const rimraf = require('rimraf');
const colorizer = winston.format.colorize();
const assert = require('assert');
// What transports to enable
const output = settings.get().advanced.log_output;
@@ -21,6 +22,8 @@ if (output.includes('file')) {
// Determine the log level.
const level = settings.get().advanced.log_level;
const validLevels = ['info', 'error', 'warn', 'debug'];
assert(validLevels.includes(level), `'${level}' is not a valid log_level, use one of '${validLevels.join(', ')}'`);
const levelWithCompensatedLength = {
'info': 'info ',