Skip to content

Instantly share code, notes, and snippets.

@juice49
Created February 13, 2015 11:19
Show Gist options
  • Save juice49/829345d5b1f6dfc6a8c3 to your computer and use it in GitHub Desktop.
Save juice49/829345d5b1f6dfc6a8c3 to your computer and use it in GitHub Desktop.
Debug console
/* global config */
'use strict';
module.exports = {
/**
* Console
*
* Use this function to call console functions, only in debug mode
* and only when the method is available in the current environment.
*
* Example:
* debug.console('log')('foo', 'bar', 'bat')
*/
console: function(method) {
return config.debug && console && console[method] ?
console[method].bind(console) :
function() {};
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment