Skip to content
Instrument a JavaScript class (or object) so that anytime a method function is called it gets logged to the console.
JavaScript
Find file
Latest commit 578efcf @feross 1.0.3
Failed to load latest commit information.
test standard
.travis.yml no node 0.8
LICENSE license
README.md readme
call-log.min.js add call-log.min.js
img.jpg readme
index.js bugfixes
package.json 1.0.3

README.md

call-log travis npm

Instrument a JavaScript class (or object) so that anytime a method function is called it gets logged to the console.

cat

browser support

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 = require('call-log')

function Cat () {}
Cat.prototype.meow = function (sound) { return sound }

// Add instrumentation to Cat
callLog(Cat)

// Use the cat
var cat = new Cat()
cat.meow()
cat.meow('MEOAAAAWWW!')

// Prints:
// "called meow"
// "called meow", "MEOAAAAWWW!"

license

MIT. Copyright (c) Feross Aboukhadijeh

Something went wrong with that request. Please try again.