license /**
 * The different verbosity levels.
 */ export const enum Level { NONE = 0 , WARN = 5 , INFO = 10 , DEBUG = 20 } /**
 * The global verbosity level for Magenta.js.
 */ export let verbosity = Level . INFO ; param msg param prefix param level export function log ( msg , prefix = 'Magenta.js' , level = Level . INFO ) { if ( level === Level . NONE ) { throw Error ( 'Logging level cannot be NONE.' ) ; } if ( verbosity >= level ) { const logMethod = level === Level . WARN ? console . warn : console . log ; logMethod ( `%c ${ prefix } ` , 'background:magenta; color:white' , msg ) ; } } param msg param startTime param prefix param level export function logWithDuration ( msg , startTime , prefix = 'Magenta.js' , level = Level . INFO ) { const durationSeconds = ( performance . now ( ) - startTime ) / 1000 ; log ( `${ msg } in ${ durationSeconds . toPrecision ( 3 ) }s` , prefix , level ) ; }