LogLevels
About:
Sensual, single file, no dependency, colour logger. Just for you baby🐬.
install:
npm install loglevels
usage:
'use strict'; /* On-Switch (special environment variable): */process.env.LOG_LEVELS_ON_FOR_COMPONENTS = 'component_a component_b component_c'; /* regular environment variables: */// process.env.ROOT_LOGGER_PATH = 'music_app';// process.env.LOG_LEVELS = 'debug warn critical';// process.env.LOGGER_COLOUR_OFF = 'true'; const component = 'component_b'; const logger = require( 'loglevels' ).setLocationAndGetLogger( __filename, component ); logger.debug( 'your message here' );logger.info( 'your message here' );logger.warn( 'your message here' );logger.error( 'your message here' );logger.critical( 'sexy monkey' );
This code sample logs the following:
(__filename
in this example is '/Users/michaelstecky-efantis/music_app/loglevels/music_app/loglevelsTest.js'
)