call-log

Instrument an object or class so that anytime one of its method is invoked it gets logged to the console.

npm install call-log
1 downloads in the last day
1 downloads in the last week
17 downloads in the last month

call-log

Build Status NPM Version NPM Gittip

In Node.js, instrument an object or class so that anytime one of its methods is invoked it gets logged to the console.

browser support

install

npm install call-log

usage

var callLog = require('call-log')

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

Cat.static1 = function () {}

// Add instrumentation to Cat
callLog(Cat)

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

// Prints:
// "Called: meow()"
// "Called: meow(MEOAAAAWWW!)"

mit license

Copyright (c) Feross Aboukhadijeh

npm loves you