Merge pull request #133 from strongloop/feature/config-loader-debug
Add more debug info for config loading
This commit is contained in:
commit
a7d6cf695c
|
@ -1,5 +1,6 @@
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
|
var debug = require('debug')('loopback:boot:config-loader');
|
||||||
|
|
||||||
var ConfigLoader = exports;
|
var ConfigLoader = exports;
|
||||||
|
|
||||||
|
@ -66,8 +67,16 @@ ConfigLoader.loadComponents = function(rootDir, env) {
|
||||||
*/
|
*/
|
||||||
function loadNamed(rootDir, env, name, mergeFn) {
|
function loadNamed(rootDir, env, name, mergeFn) {
|
||||||
var files = findConfigFiles(rootDir, env, name);
|
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);
|
var configs = loadConfigFiles(files);
|
||||||
return mergeConfigurations(configs, mergeFn);
|
var merged = mergeConfigurations(configs, mergeFn);
|
||||||
|
|
||||||
|
debug('merged %s %s configuration %j', env, name, merged);
|
||||||
|
|
||||||
|
return merged;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue