lib/Plugins.class.js
/**
     * Make a plugin available to the system.
     * @param {Plugin} plugin
     */
Make a plugin available to the system.
@param {Plugin} plugin
Make a plugin available to the system . @param { Plugin } plugin
register(plugin) {
        if (!_.isFunction(plugin)) {
            throw new Error("To register plugins please pass in the constructor/class definition instead of an instance.");
        }
        if (plugin.prototype instanceof Appender) {
            this.registered.appenders[plugin.name] = plugin;
        }  else if (plugin.prototype instanceof Processor) {
            this.registered.processors[plugin.name] = plugin;
        } else if (plugin.prototype instanceof Configurator) {
            this.registered.configurators[plugin.name] = plugin;
        } else {
            throw new Error('To register plugins they must implement one of the plugin interfaces!');
        }
        this.emit('register', plugin.name);
    }
register ( plugin ) { if ( ! _ . isFunction ( plugin ) ) { throw new Error ( "To register plugins please pass in the constructor/class definition instead of an instance." ) ; } if ( plugin . prototype instanceof Appender ) { this . registered . appenders [ plugin . name ] = plugin ; } else if ( plugin . prototype instanceof Processor ) { this . registered . processors [ plugin . name ] = plugin ; } else if ( plugin . prototype instanceof Configurator ) { this . registered . configurators [ plugin . name ] = plugin ; } else { throw new Error ( 'To register plugins they must implement one of the plugin interfaces!' ) ; } this . emit ( 'register' , plugin . name ) ; }
Make a plugin available to the system.
Make a plugin available to the system .