From 1a0532b77bc333454c4fcdcb3d992ca53f56ba16 Mon Sep 17 00:00:00 2001 From: cel Date: Mon, 30 Jan 2017 23:36:47 -0800 Subject: Simplify log prefix --- lib/app.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/lib/app.js b/lib/app.js index a7533ce..7645cd1 100644 --- a/lib/app.js +++ b/lib/app.js @@ -45,15 +45,9 @@ App.prototype.go = function () { }) } -App.prototype.logPrefix = ['[' + pkg.name + ']'] - -App.prototype.log = function () { - console.log.apply(console, [].concat.apply(this.logPrefix, arguments)) -} - -App.prototype.error = function () { - console.error.apply(console, [].concat.apply(this.logPrefix, arguments)) -} +var logPrefix = '[' + pkg.name + ']' +App.prototype.log = console.log.bind(console, logPrefix) +App.prototype.error = console.error.bind(console, logPrefix) App.prototype.unboxMsg = function (msg, cb) { var self = this -- cgit v1.2.3