nl_tokens: Add new wrapper . Can handle any object with one of methods from array : [ log silly debug info warn error ]
pl_tokens: function addWrapper ( <mask> , { passInitialArguments = false , plugins = [ ] } = { } ) { const opts = { passInitialArguments , plugins : normalizeArray ( plugins ) } ; if ( typeof wrapper === 'object' && ! Array . isArray ( wrapper ) && ( typeof wrapper . log === 'function' || Object . keys ( LEVELS ) . some ( ( lvl ) => typeof wrapper [ lvl . toLowerCase ( ) ] === 'function' ) ) ) { // if wrapper is instance of some class or pure object, it must include at least one method with level name wrapper [ WRAPPER_OPTS_SYMBOL ] = opts ; wrappers . push ( wrapper ) ; return ; } if ( typeof wrapper === 'function' ) { const wrapperObject = { log : wrapper , [ WRAPPER_OPTS_SYMBOL ] : opts } ; wrappers . push ( wrapperObject ) ; return ; } throw new Error ( 'Wrapper did not implemented a minimum methods required' ) ; }