Created
February 13, 2015 11:19
-
-
Save juice49/829345d5b1f6dfc6a8c3 to your computer and use it in GitHub Desktop.
Debug console
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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