UNPKG

@starryinternet/jobi

Version:

Tiny logging utility with events and streams

16 lines (13 loc) 290 B
/** * Format the log using JSON.stringify. * * @param {Log} log - the log object * @returns {string} */ function json( log ) { if ( typeof log.level === 'string' ) { log = { ...log, level: log.level.toUpperCase() }; } return JSON.stringify( log ); } module.exports = json;