From 8b6dc6ceec1b36e74ee9c6d362aa04e46237c227 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Sun, 26 Feb 2017 13:45:35 -0500 Subject: [PATCH] Use "%o" in path debug to tell types apart --- History.md | 1 + lib/router/index.js | 2 +- lib/router/layer.js | 2 +- lib/router/route.js | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/History.md b/History.md index 2b20beb717..ed51a7e5b0 100644 --- a/History.md +++ b/History.md @@ -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 diff --git a/lib/router/index.js b/lib/router/index.js index 2c4239eba1..d2ed86e0bc 100644 --- a/lib/router/index.js +++ b/lib/router/index.js @@ -452,7 +452,7 @@ proto.use = function use(fn) { } // add the middleware - debug('use %s %s', path, fn.name || ''); + debug('use %o %s', path, fn.name || '') var layer = new Layer(path, { sensitive: this.caseSensitive, diff --git a/lib/router/layer.js b/lib/router/layer.js index 6325df8aff..4dc8e86d4f 100644 --- a/lib/router/layer.js +++ b/lib/router/layer.js @@ -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; diff --git a/lib/router/route.js b/lib/router/route.js index 2788d7b735..1ec9d50ea0 100644 --- a/lib/router/route.js +++ b/lib/router/route.js @@ -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;