Console Hook
Hook into the console
for transparent log recording in production and log capture for testing.
npm install console-hook
Works in the browser too, just grab console-hook/index.js
.
Examples
console
method calls
Intercept all var Hook = ;var myHook = ; // okay, we're done playing with the console stuffsmyHook;
console
method calls and don't call console
Intercept all var Hook = ;var silence = true; // could be `isProduction`var myHook = ; // okay, we're done playing with the console stuffsmyHook;
console.error
calls
Intercept only var Hook = ;var myHook = ; // okay, we're done playing with the console stuffsmyHook;
console
-like Logger
Use another // if you have an Ember app and already use Ember.Loggervar Hook = ;var myHook = ; // okay, we're done playing with the console stuffsmyHook;
Contributing
Contributions are incredibly welcome as long as they are standardly applicable
and pass the tests (or break bad ones). Tests are written in Mocha and
assertions are done with the Node.js core assert
module.
# running tests npm run test
Follow me on Twitter for updates or just for the lolz and please check out my other repositories if I have earned it. I thank you for reading.