Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

node-squarespace-logger

0.1.1 • Public • Published

node-squarespace-logger

Shared logging utility for node-squarespace- modules.

Installation

npm install node-squarespace-logger

Updating

npm update node-squarespace-logger

Usage

var sqsLogger = require( "node-squarespace-logger" );
 
// Log some useful stuff
sqsLogger.log( context, message );
 
// Silence the logger
sqsLogger.silence();
 
// Pass your logger around to child modules to retain the silence
var myModule = require( "./my-module" )( sqsLogger );
 
// or like this
var myModule = require( "./my-module" );
myModule.setLogger( sqsLogger );

These are the context types for the logger

  • info ( white )
  • warn ( yellow )
  • error ( red )
  • server ( magenta )
  • cache ( green )
  • template ( cyan )

Pull Requests

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

install

npm i node-squarespace-logger

Downloadsweekly downloads

3

version

0.1.1

license

none

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability