11cb0ef41Sopenharmony_ci// emits 'log' events on the process 21cb0ef41Sopenharmony_ciconst LEVELS = [ 31cb0ef41Sopenharmony_ci 'notice', 41cb0ef41Sopenharmony_ci 'error', 51cb0ef41Sopenharmony_ci 'warn', 61cb0ef41Sopenharmony_ci 'info', 71cb0ef41Sopenharmony_ci 'verbose', 81cb0ef41Sopenharmony_ci 'http', 91cb0ef41Sopenharmony_ci 'silly', 101cb0ef41Sopenharmony_ci 'pause', 111cb0ef41Sopenharmony_ci 'resume', 121cb0ef41Sopenharmony_ci] 131cb0ef41Sopenharmony_ci 141cb0ef41Sopenharmony_ciconst log = level => (...args) => process.emit('log', level, ...args) 151cb0ef41Sopenharmony_ci 161cb0ef41Sopenharmony_ciconst logger = {} 171cb0ef41Sopenharmony_cifor (const level of LEVELS) { 181cb0ef41Sopenharmony_ci logger[level] = log(level) 191cb0ef41Sopenharmony_ci} 201cb0ef41Sopenharmony_ci 211cb0ef41Sopenharmony_cilogger.LEVELS = LEVELS 221cb0ef41Sopenharmony_ci 231cb0ef41Sopenharmony_cimodule.exports = logger 24