use .storeName during tracing (#560)

This commit is contained in:
Yoshua Wuyts
2017-10-03 12:34:36 -04:00
committed by GitHub
parent db07336845
commit 92372b9bff
2 changed files with 8 additions and 2 deletions
+3 -1
View File
@@ -77,7 +77,9 @@ Choo.prototype.route = function (route, handler) {
Choo.prototype.use = function (cb) {
assert.equal(typeof cb, 'function', 'choo.use: cb should be type function')
var endTiming = nanotiming('choo.use')
var msg = 'choo.use'
msg = cb.storeName ? msg + '(' + cb.storeName + ')' : msg
var endTiming = nanotiming(msg)
cb(this.state, this.emitter, this)
endTiming()
}