0.1.1 • Published 6 years ago

nice_debug v0.1.1

Weekly downloads
-
License
GPL-3.0
Repository
-
Last release
6 years ago

nice-debug

compact functionality to debug modules without unnecessarily overloading the logs

Overview

nice-debug provides a compact functions that will write certain messages to log only if an environment variable corrosponding to the debug symbol chosen is set to the desired debug level

Installation

npm install --save nice_debug

Usage

  • In your terminal:
export MY_DEBUG_SYMBOL=2
  • In your code:
const debug = require('nice_debug')("MY_DEBUG_SYMBOL")

debug(1, "this message will be written because the debug environment variable is set to 2");
debug(2, "this message will also be written");
debug(3, "this message will not be written");