Use "%o" in path debug to tell types apart

This commit is contained in:
Douglas Christopher Wilson 2017-02-26 13:45:35 -05:00
parent 081b811b10
commit 8b6dc6ceec
4 changed files with 5 additions and 4 deletions

View File

@ -5,6 +5,7 @@ unreleased
* Remove usage of `res._headers` private field
- Improves compatibility with Node.js 8 nightly
* Skip routing when `req.url` is not set
* Use `%o` in path debug to tell types apart
* Use `Object.create` to setup request & response prototypes
* Use `setprototypeof` module to replace `__proto__` setting
* Use `statuses` instead of `http` module for status messages

View File

@ -452,7 +452,7 @@ proto.use = function use(fn) {
}
// add the middleware
debug('use %s %s', path, fn.name || '<anonymous>');
debug('use %o %s', path, fn.name || '<anonymous>')
var layer = new Layer(path, {
sensitive: this.caseSensitive,

View File

@ -35,7 +35,7 @@ function Layer(path, options, fn) {
return new Layer(path, options, fn);
}
debug('new %s', path);
debug('new %o', path)
var opts = options || {};
this.handle = fn;

View File

@ -44,7 +44,7 @@ function Route(path) {
this.path = path;
this.stack = [];
debug('new %s', path);
debug('new %o', path)
// route handlers for various http methods
this.methods = {};
@ -196,7 +196,7 @@ methods.forEach(function(method){
throw new Error(msg);
}
debug('%s %s', method, this.path);
debug('%s %o', method, this.path)
var layer = Layer('/', {}, handle);
layer.method = method;