Augments logging via the console object with log levels and other useful stuff
Last updated 2 years ago by rotous .
AGPL-3.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install console-augmenter 
SYNC missed versions from official npm registry.


All modern browsers and NodeJS support the functions console.debug(), console.log(),, console.warn() and console.error(). And some browsers even have a feature to only show what you want in the developer tools console.

This module however adds functionality to set the log level in the code. This way you can leave your debug logging in your code and just set another log level for your production build so the end user will not see the logs.


If you have an NPM project you can use:

npm install console-augmenter

and include the script as

import 'console-augmenter';

Otherwise you can download the bundle.min.js (together with, put it somewhere in your project and add it to your html with:

<script src='<LOCATION_RELATIVE_TO_YOUR_HTML_FILE/>bundle.min.js'></script>


When you have included the script, you can just use the functions console.debug, console.log,, console.warn and console.error just like you are used to.

Change the log level of your application by calling the logLevel() function:

console.logLevel(console.LL_ERROR); // only log error messages

Use one of these log levels:

  • console.LL_ALL
  • console.LL_LOG
  • console.LL_INFO
  • console.LL_WARN
  • console.LL_ERROR
  • console.LL_NONE

Add timestamps to your logs with the addTimestamps() function:

console.log('Hello world!); \\ [date - time] Hello world!
console.log('Hello world!); \\ Hello world!

Current Tags

  • 0.0.3                                ...           latest (2 years ago)

3 Versions

  • 0.0.3                                ...           2 years ago
  • 0.0.2                                ...           2 years ago
  • 0.0.1                                ...           2 years ago
Maintainers (1)
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 3
Dependencies (0)
Dev Dependencies (11)
Dependents (1)

Copyright 2014 - 2017 © |