add debug() for .listen() and .keys=

This commit is contained in:
TJ Holowaychuk 2013-11-26 21:26:05 -08:00
parent e447e731b6
commit 309f2ac00e

View file

@ -63,6 +63,7 @@ Application.prototype.__proto__ = Emitter.prototype;
*/ */
app.listen = function(){ app.listen = function(){
debug('listen');
var server = http.createServer(this.callback()); var server = http.createServer(this.callback());
return server.listen.apply(server, arguments); return server.listen.apply(server, arguments);
}; };
@ -116,6 +117,7 @@ app.callback = function(){
app.__defineSetter__('keys', function(keys){ app.__defineSetter__('keys', function(keys){
var ok = Array.isArray(keys) || keys instanceof Keygrip; var ok = Array.isArray(keys) || keys instanceof Keygrip;
debug('keys %j', keys);
if (!ok) throw new TypeError('app.keys must be an array or Keygrip'); if (!ok) throw new TypeError('app.keys must be an array or Keygrip');
if (!(keys instanceof Keygrip)) keys = new Keygrip(keys); if (!(keys instanceof Keygrip)) keys = new Keygrip(keys);
this._keys = keys; this._keys = keys;