Add logging

I don't see a reason for `var self = this` here, also, there is usually no reason for this pattern anymore since there is `Function.prototype.bind`