From 50d99c7e6b551a019af86bb78e0c034badb266aa Mon Sep 17 00:00:00 2001 From: Ritchie Martori Date: Wed, 3 Jun 2015 11:10:36 -0700 Subject: [PATCH] Add more debug info for config loading --- lib/config-loader.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/config-loader.js b/lib/config-loader.js index 2add670..cd7926a 100644 --- a/lib/config-loader.js +++ b/lib/config-loader.js @@ -1,5 +1,6 @@ var fs = require('fs'); var path = require('path'); +var debug = require('debug')('loopback:boot:config-loader'); var ConfigLoader = exports; @@ -66,8 +67,16 @@ ConfigLoader.loadComponents = function(rootDir, env) { */ function loadNamed(rootDir, env, name, mergeFn) { var files = findConfigFiles(rootDir, env, name); + if (files.length) { + debug('found %s %s files', env, name); + files.forEach(function(f) { debug(' %s', f); }); + } var configs = loadConfigFiles(files); - return mergeConfigurations(configs, mergeFn); + var merged = mergeConfigurations(configs, mergeFn); + + debug('merged %s %s configuration %j', env, name, merged); + + return merged; } /**