logging-facility.js
function createLogger(instance){

    // generator
    function log(level){
        return function(...args){

            // logging backend available ?
            if (_loggingBackends.length > 0){

                // trigger backends
                _loggingBackends.forEach(function(backend){
                    backend.apply(backend, [instance, level, args]);
                });

            // use default backend
            }else{
                _defaultBackend.apply(_defaultBackend, [instance, level, args]);
            }
        }
    }
    
    return exposeAPI(log);
}
function createLogger(instance){

    // generator
    function log(level){
        return function(...args){

            // logging backend available ?
            if (_loggingBackends.length > 0){

                // trigger backends
                _loggingBackends.forEach(function(backend){
                    backend.apply(backend, [instance, level, args]);
                });

            // use default backend
            }else{
                _defaultBackend.apply(_defaultBackend, [instance, level, args]);
            }
        }
    }
    
    return exposeAPI(log);
}
function createLogger ( instance ) { // generator function log ( level ) { return function ( ... args ) { // logging backend available ? if ( _loggingBackends . length > 0 ) { // trigger backends _loggingBackends . forEach ( function ( backend ) { backend . apply ( backend , [ instance , level , args ] ) ; } ) ; // use default backend } else { _defaultBackend . apply ( _defaultBackend , [ instance , level , args ] ) ; } } } return exposeAPI ( log ) ; }
generator to create the logging instance
generator to create the logging instance