scelerat / console-manager

Utility for managing console output

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Module /  function to manage console output in a browser-based JS app

Example : 

(function(){
  // a config step in your app
  var cm = ConsoleManager(),
      enabled = [ 'photos', 'comments', 'blogs' ],
      disabled = [ 'music', 'movies' ];
  for (var i = 0; i < enabled.length; i++ ) { cm.enable( enabled[i] )};
  for (var i = 0; i < disabled.length; i++ ) { cm.enable( disabled[i] )};
})();

(function(){
  // A module definition in your app
  var console = ConsoleManager().console('photos');
  console.log("You should see this in console output");
})();

(function(){
  // Another module definition in your app
  var console = ConsoleManager().console('movies');
  console.log("You should NOT see this in console output");
})();

davidkurtz@me.com

About

Utility for managing console output


Languages

Language:JavaScript 100.0%