From 5f6ecfda493360f7c5169db4762b13ca9a85ef8e Mon Sep 17 00:00:00 2001 From: Mike McNeil Date: Mon, 25 Jun 2018 15:27:32 -0500 Subject: [PATCH] Add failsafe re https://github.com/balderdashy/sails/issues/4395 and https://github.com/balderdashy/captains-log/pull/22 --- lib/configure.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/configure.js b/lib/configure.js index d50d962..c85a4de 100644 --- a/lib/configure.js +++ b/lib/configure.js @@ -154,6 +154,10 @@ module.exports = function(overrides) { // Use the appropriate color for the log level. var colorMappings = _.isObject(options.colors) ? options.colors : {}; var colorName = colorMappings[logAt]; + // Failsafe in case of troublesome configuration: + if (colorName === undefined) { + colorName = 'white'; + } // Get the ANSI-colorized prefix. var colorizedPrefix = (function _getColorizedPrefix() {