nl_tokens: In order to ease the transition from using the debug module for logging to using this library we have a function that allows the root logger to expose an api similar to the debug module . The first returned function takes a name to use as the debug name and returns a function which accepts log messages . The log messages can use util . format formatting to produce desired output .
pl_tokens: function makeCompat ( logger ) { return function ( name ) { return function ( ... x ) { assume ( x ) . is . an ( 'array' ) ; assume ( x . length ) . greaterThan ( 0 ) ; let msg = util . format . apply ( null , x ) ; let level = 'warn' ; let msgObj = { dbgname : name , dbgcmpt : true , } ; if ( msg . match ( / \[alert-operator\] / ) ) { level = 'fatal' ; msgObj . alert = true ; } logger [ <mask> ] . call ( logger , msgObj , msg ) ; } ; } ; }