call-log
Instrument a JavaScript class (or object) so that anytime a method function is called it gets logged to the console.
install
npm install call-log
This module works in the browser with browserify.
Note: If you're NOT using browserify, then use the included standalone file
call-log.min.js
. This exports a CallLog
constructor on window
.
usage
var callLog = {}Catprototype { return sound } // Add instrumentation to Cat // Use the catvar cat = catcat // Prints:// "called meow"// "called meow", "MEOAAAAWWW!"
license
MIT. Copyright (c) Feross Aboukhadijeh