1.0.4 • Published 6 years ago
log_by_level v1.0.4
A logger for managing console logs / warnings / fatal / error messages.
You set up a threshold for message importance depending on the types of notifications you would like to see on the console.
Order of importance FATAL > ERROR > WARN > INFO.
An import statement is expected to include the setLog function and desired log thresholds.
Example:
import setLog, { NONE, FATAL, ERROR, WARN, INFO }
const logger = setLog(WARN);
logger.fatal('displayed')
logger.error('displayed')
logger.warn('displayed')
logger.info('hidden')
const logger2 = setLog(FATAL);
logger2.fatal('displayed')
logger2.error('hidden')
logger2.warn('hidden')
logger2.info('hidden')