Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Instrument an object or class so that anytime one of its methods is invoked it gets logged to the console (in Node.js)
branch: master

This branch is 33 commits behind feross:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
test
.gitignore
.jshintrc
.travis.yml
LICENSE
README.md
index.js
package.json

README.md

call-log

Build Status

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

Installation

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

Something went wrong with that request. Please try again.