Extensible, to add other log redirection, filtering, or formatting functionality, while keeping all the above (except you will clobber your stacktrace, see Plugins below).TypeScript type definitions included, so no need for extra packages.Magically handles situations where console logging is not initially available (IE8/9), and automatically enables logging as soon as it does become available (when developer console is opened).Logging is filtered to "warn" level by default, to keep your live site clean in normal usage (or you can trivially re-enable everything with an initial log.enableAll() call).It works with all the standard JavaScript loading systems out of the box (CommonJS, AMD, or just as a global).Log output keeps line numbers: most JS logging frameworks call console.log methods through wrapper functions, clobbering your stacktrace and making the extra info many browsers provide useless.This then comes together giving a consistent reliable API that works in every JavaScript environment with a console available, and never breaks anything anywhere else.Logging calls still succeed even if there's no console object at all, so your site doesn't break when people visit with old browsers that don't support the console object (here's looking at you IE) and similar.Log methods gracefully fall back to simpler console logging methods if more specific ones aren't available: so calls to log.debug() go to bug() if possible, or console.log() if not.Single file, no dependencies, weighs in at 1.1KB minified and gzipped.Filter logging by level (all the above or 'silent'), so you can disable all but error logging in production, and then run log.setLevel("trace") in your console to turn it all back on for a furious debugging session.Log things at a given level (trace/debug/info/warn/error) to the console object (as seen in all modern browsers & node.js).It does not do fancy things, it does not let you reconfigure appenders or add complex log filtering rules or boil tea (more's the pity), but it does have the all core functionality that you actually use: Features Simple This is a barebones reliable everyday logging library. loglevel replaces console.log() and friends with level-based logging and filtering, with none of console's downsides.
Minimal lightweight simple logging for JavaScript. Don't debug with logs alone - check out HTTP Toolkit: beautiful, powerful & open-source tools for building, testing & debugging HTTP(S)