From 032f1ec02a7b851704ed1bf119e47e3d672ad407 Mon Sep 17 00:00:00 2001 From: "Nicholas C. Zakas" Date: Fri, 16 Nov 2018 13:29:11 -0800 Subject: [PATCH] Add more debug messages --- lib/util/config-comment-parser.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/util/config-comment-parser.js b/lib/util/config-comment-parser.js index dee8e55da52..37118e13aff 100644 --- a/lib/util/config-comment-parser.js +++ b/lib/util/config-comment-parser.js @@ -39,6 +39,8 @@ module.exports = class ConfigCommentParser { * @returns {Object} Result map object of names and boolean values */ parseBooleanConfig(string, comment) { + debug("Parsing Boolean config"); + const items = {}; // Collapse whitespace around `:` and `,` to make parsing easier @@ -67,6 +69,8 @@ module.exports = class ConfigCommentParser { * @returns {({success: true, config: Object}|{success: false, error: Problem})} Result map object */ parseJsonConfig(string, location) { + debug("Parsing JSON config"); + let items = {}; // Parses a JSON-like comment by the same way as parsing CLI option. @@ -85,6 +89,7 @@ module.exports = class ConfigCommentParser { } } catch (ex) { + debug("Levn parsing failed; falling back to manual parsing."); // ignore to parse the string by a fallback. } @@ -98,6 +103,8 @@ module.exports = class ConfigCommentParser { try { items = JSON.parse(`{${normalizedString}}`); } catch (ex) { + debug("Manual parsing failed."); + return { success: false, error: { @@ -124,6 +131,8 @@ module.exports = class ConfigCommentParser { * @returns {Object} Result map of values and true values */ parseListConfig(string) { + debug("Parsing list config"); + const items = {}; // Collapse whitespace around commas