lib/solid-logger.js
function init(configuration){
    var self = {
        config : configuration,
        adapters : [],
        getWhenCurrentWritesDone : getWhenCurrentWritesDone
    };

    _.each(self.config.adapters, function(adapter){
        var adapterInstance;

        try {
            adapterInstance = require('./adapters/' + adapter.type).init(adapter);
        } catch (e) {
            console.log(chalk.red('Initialization Error: '), e);
            throw e;
        }

        adapterInstance.writeQueue = BB.resolve();

        self.adapters.push(adapterInstance);
    });

    [
        'error',
        'info',
        'debug',
        'warn',
        'trace',
        'critical'
    ].forEach(function (type) {
        /**
         * Create a TYPE log entry
         * @param category Categorize your error with a user defined label
         * @param args Include your customized messages. This should be a comma separated list just like `console.log`
         */
        self[type] = function () {
            // If we are still logging and there are messages to write
            if(arguments.length > 0){
                var category = (arguments.length > 1 && _.isString(arguments[0])) ? arguments[0] : '',
                    startIdx = (arguments.length > 1) ? 1 : 0;

                _write.call(self, type, category, Array.prototype.slice.call(arguments, startIdx));
            }
        };
    });

    return self;
}
function init(configuration){
    var self = {
        config : configuration,
        adapters : [],
        getWhenCurrentWritesDone : getWhenCurrentWritesDone
    };

    _.each(self.config.adapters, function(adapter){
        var adapterInstance;

        try {
            adapterInstance = require('./adapters/' + adapter.type).init(adapter);
        } catch (e) {
            console.log(chalk.red('Initialization Error: '), e);
            throw e;
        }

        adapterInstance.writeQueue = BB.resolve();

        self.adapters.push(adapterInstance);
    });

    [
        'error',
        'info',
        'debug',
        'warn',
        'trace',
        'critical'
    ].forEach(function (type) {
        /**
         * Create a TYPE log entry
         * @param category Categorize your error with a user defined label
         * @param args Include your customized messages. This should be a comma separated list just like `console.log`
         */
        self[type] = function () {
            // If we are still logging and there are messages to write
            if(arguments.length > 0){
                var category = (arguments.length > 1 && _.isString(arguments[0])) ? arguments[0] : '',
                    startIdx = (arguments.length > 1) ? 1 : 0;

                _write.call(self, type, category, Array.prototype.slice.call(arguments, startIdx));
            }
        };
    });

    return self;
}
function init ( configuration ) { var self = { config : configuration , adapters : [ ] , getWhenCurrentWritesDone : getWhenCurrentWritesDone } ; _ . each ( self . config . adapters , function ( adapter ) { var adapterInstance ; try { adapterInstance = require ( './adapters/' + adapter . type ) . init ( adapter ) ; } catch ( e ) { console . log ( chalk . red ( 'Initialization Error: ' ) , e ) ; throw e ; } adapterInstance . writeQueue = BB . resolve ( ) ; self . adapters . push ( adapterInstance ) ; } ) ; [ 'error' , 'info' , 'debug' , 'warn' , 'trace' , 'critical' ] . forEach ( function ( type ) { /**
         * Create a TYPE log entry
         * @param category Categorize your error with a user defined label
         * @param args Include your customized messages. This should be a comma separated list just like `console.log`
         */ self [ type ] = function ( ) { // If we are still logging and there are messages to write if ( arguments . length > 0 ) { var category = ( arguments . length > 1 && _ . isString ( arguments [ 0 ] ) ) ? arguments [ 0 ] : '' , startIdx = ( arguments . length > 1 ) ? 1 : 0 ; _write . call ( self , type , category , Array . prototype . slice . call ( arguments , startIdx ) ) ; } } ; } ) ; return self ; }
Public method required to load in all of the configuration info for adapters.
Init initialize and reinitializes, so the list of adapters is set to empty before it runs.
@param configuration Object for your adapters.
@returns {logger}
Public method required to load in all of the configuration info for adapters . Init initialize and reinitializes so the list of adapters is set to empty before it runs .