From d6ed202bd96235e8f48796e5369e30c55367a2a8 Mon Sep 17 00:00:00 2001 From: Ayush Sharma Date: Thu, 5 Oct 2017 22:36:58 +0530 Subject: [PATCH] fix: plugin loader with logs fix: warn replaced with info --- src/lib/plugin-loader.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/plugin-loader.js b/src/lib/plugin-loader.js index 904fc48bf..87eefc407 100644 --- a/src/lib/plugin-loader.js +++ b/src/lib/plugin-loader.js @@ -1,6 +1,7 @@ 'use strict'; const Path = require('path'); +const logger = require('./logger'); /** * Requires a module. @@ -55,19 +56,22 @@ function load_plugins(config, plugin_configs, params, sanity_check) { } if (plugin === null) { + logger.logger.error({content: p}, 'plugin not found. try npm install verdaccio-@{content}'); throw Error('"' + p + '" plugin not found\ntry "npm install verdaccio-' + p + '"'); } if (typeof(plugin) !== 'function') { + logger.logger.error({content: p}, '@{content} doesn\'t look like a valid plugin'); throw Error('"' + p + '" doesn\'t look like a valid plugin'); } plugin = plugin(plugin_configs[p], params); if (plugin === null || !sanity_check(plugin)) { + logger.logger.error({content: p}, '@{content} doesn\'t look like a valid plugin'); throw Error('"' + p + '" doesn\'t look like a valid plugin'); } - + logger.logger.info({content: p}, 'Plugin successfully loaded: @{content}'); return plugin; });