From 0626c216c0594a46fb316e51e67cb84d720bd985 Mon Sep 17 00:00:00 2001 From: Aaron Wagner Date: Wed, 17 Aug 2016 09:45:31 -0500 Subject: [PATCH 1/2] Added debug handler Debug handler was missing. Added it in so that debug messages get logged to console correctly. --- src/logger.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/logger.js b/src/logger.js index 30a0906..6992c3e 100644 --- a/src/logger.js +++ b/src/logger.js @@ -222,6 +222,8 @@ hdlr = console.error; } else if (context.level === Logger.INFO && console.info) { hdlr = console.info; + } else if (context.level === Logger.DEBUG && console.debug) { + hdlr = console.debug; } options.formatter(messages, context); From b914a2a0c79138bf7af81c0db835fcc1551e9465 Mon Sep 17 00:00:00 2001 From: Aaron Wagner Date: Thu, 18 Aug 2016 09:52:32 -0500 Subject: [PATCH 2/2] Change to test Committing so I can test on another machne. --- test-src/loggertests.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test-src/loggertests.js b/test-src/loggertests.js index d56b2d6..7812f51 100644 --- a/test-src/loggertests.js +++ b/test-src/loggertests.js @@ -163,7 +163,7 @@ var logger = this.logger; var sandbox = sinon.sandbox.create(); - sandbox.stub(console, "log"); + sandbox.stub(console, "debug"); sandbox.stub(console, "info"); sandbox.stub(console, "warn"); sandbox.stub(console, "error"); @@ -174,7 +174,7 @@ logger.warn("warning message"); logger.error("error message"); - assert.ok(console.log.calledOnce, "logger.debug calls console.log"); + assert.ok(console.debug.calledOnce, "logger.debug calls console.debug"); assert.ok(console.info.calledOnce, "logger.info calls console.info"); assert.ok(console.warn.calledOnce, "logger.warn calls console.warn"); assert.ok(console.error.calledOnce, "logger.error calls console.error");