loug

1.0.2 • Public • Published

Loug

Console for debugging messages, errors and warnings in projects that are in development.

Installation

$ npm install --save loug

Add the production key in your package.json.

{
  "name": "testing",
  "version": "3.2.1",
  "description": "description testing",
  "main": "index.js",
  "scripts": {
  },
  "keywords": [
  ],
  "dependencies": {
  },
  "production": false    //=> This key
}

The key production is boolean type, true is production.

When the key is set to true the messages are not displayed. The opposite happens when it is false.

Usage

"production": false

var loug = require('loug');
 
loug("Hello")
//=> Hello
loug.warn("an advert")
//=> an advert
loug.ignore("Any argument or message")
//=> Any argument or message

"production": true

var loug = require('loug');
 
loug("Hello")
loug.warn("an advert")
loug.ignore("Any argument or message")
//=> Any argument or message

API

log(msg...)

Logs the message as if you called console.log

error(msg...)

Logs the message as if you called console.error

warn(msg...)

Logs the message as if you called console.warn

info(msg...)

Logs the message as if you called console.info

dir(msg...)

Logs the message as if you called console.dir

ignore(msg...)

Logs the message as if you called console.log. Logs the message in production and development.

Ignore all

Ignore the 'production' key and enable log, error, warn, dir and info. Only applies to the current document.

var loug = require('loug');
 
loug.set(true);

LICENCE

MIT

Package Sidebar

Install

npm i loug

Weekly Downloads

1

Version

1.0.2

License

MIT

Last publish

Collaborators

  • anlijudavid