diff --git a/src/core/Common.js b/src/core/Common.js index bef7025c..b9274441 100644 --- a/src/core/Common.js +++ b/src/core/Common.js @@ -323,7 +323,7 @@ module.exports = Common; */ Common.log = function() { if (console && Common.logLevel > 0 && Common.logLevel <= 3) { - console.log.apply(console, [Matter.name + ':'].concat(Array.prototype.slice.call(arguments))); + console.log.apply(console, ['matter-js:'].concat(Array.prototype.slice.call(arguments))); } }; @@ -335,7 +335,7 @@ module.exports = Common; */ Common.info = function() { if (console && Common.logLevel > 0 && Common.logLevel <= 2) { - console.info.apply(console, [Matter.name + ':'].concat(Array.prototype.slice.call(arguments))); + console.info.apply(console, ['matter-js:'].concat(Array.prototype.slice.call(arguments))); } }; @@ -347,7 +347,7 @@ module.exports = Common; */ Common.warn = function() { if (console && Common.logLevel > 0 && Common.logLevel <= 3) { - console.warn.apply(console, [Matter.name + ':'].concat(Array.prototype.slice.call(arguments))); + console.warn.apply(console, ['matter-js:'].concat(Array.prototype.slice.call(arguments))); } }; diff --git a/src/core/Plugin.js b/src/core/Plugin.js index 6651d433..1585cce1 100644 --- a/src/core/Plugin.js +++ b/src/core/Plugin.js @@ -75,10 +75,9 @@ var Common = require('./Common'); } var dependencies = Plugin.trackDependencies(base), - sortedDependencies = Common.topologicalSort(dependencies); + sortedDependencies = Common.topologicalSort(dependencies), + status = []; - console.log(dependencies, sortedDependencies); - for (var i = 0; i < sortedDependencies.length; i += 1) { if (sortedDependencies[i] === base.name) { continue; @@ -86,22 +85,27 @@ var Common = require('./Common'); var plugin = Plugin.resolve(sortedDependencies[i]); + if (!plugin) { + status.push('❌ ' + sortedDependencies[i]); + } + if (!plugin || Plugin.isUsed(base, plugin.name)) { continue; } if (!Plugin.isFor(plugin, base)) { - Common.log('Plugin.installDependencies: ' + Plugin.toString(plugin) + ' is for ' + plugin.for + ' but installed on ' + Plugin.toString(base) + '.', 'warn'); + Common.warn('Plugin.installDependencies:', Plugin.toString(plugin), 'is for', plugin.for, 'but installed on', Plugin.toString(base) + '.'); } if (plugin.install) { plugin.install(base); + status.push('✅ ' + Plugin.toString(plugin)); } base.used.push(plugin.name); } - console.log(base.used); + Common.info('Plugin status:', status.join(', ')); }; Plugin.trackDependencies = function(base, tracked) {