From 1712146836a4e7d859c5078c2f492e4e58ec99bc Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Wed, 4 Feb 2015 21:29:11 +0000 Subject: [PATCH] Clear loghandlers on init and supress output in tests --- red/log.js | 2 ++ test/nodes/helper.js | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/red/log.js b/red/log.js index 5f6b30b70..faa93aacd 100644 --- a/red/log.js +++ b/red/log.js @@ -19,6 +19,7 @@ var EventEmitter = require("events").EventEmitter; var levels = { + off: 0, fatal: 10, error: 20, warn: 30, @@ -72,6 +73,7 @@ var log = module.exports = { METRIC: 99, init: function(settings) { + logHandlers = []; var consoleSettings = {}; if (settings.logging) { consoleSettings = settings.logging.console || {}; diff --git a/test/nodes/helper.js b/test/nodes/helper.js index e610f198f..45b6d9861 100644 --- a/test/nodes/helper.js +++ b/test/nodes/helper.js @@ -123,7 +123,9 @@ module.exports = { startServer: function(done) { server = http.createServer(function(req,res){app(req,res);}); - RED.init(server, {}); + RED.init(server, { + logging:{console:{level:'off'}} + }); server.listen(listenPort, address); server.on('listening', function() { port = server.address().port;