From 09bc69df7a82ff7c7a3bc4d8c9feef8a64a7c517 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 11 May 2016 20:43:07 +0200 Subject: Add debug electron setting --- server/lib/webtorrent.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'server/lib/webtorrent.js') diff --git a/server/lib/webtorrent.js b/server/lib/webtorrent.js index e2e2586f9..656f8c7a8 100644 --- a/server/lib/webtorrent.js +++ b/server/lib/webtorrent.js @@ -7,6 +7,7 @@ const spawn = require('electron-spawn') const logger = require('../helpers/logger') +const electron_debug = config.get('electron.debug') let host = config.get('webserver.host') let port = config.get('webserver.port') let nodeKey = 'webtorrentnode' + port @@ -57,13 +58,16 @@ function create (options, callback) { }) const webtorrent_process = spawn(pathUtils.join(__dirname, 'webtorrentProcess.js'), host, port, { detached: true }) - webtorrent_process.stderr.on('data', function (data) { - // logger.debug('Webtorrent process stderr: ', data.toString()) - }) - webtorrent_process.stdout.on('data', function (data) { - // logger.debug('Webtorrent process:', data.toString()) - }) + if (electron_debug === true) { + webtorrent_process.stderr.on('data', function (data) { + logger.debug('Webtorrent process stderr: ', data.toString()) + }) + + webtorrent_process.stdout.on('data', function (data) { + logger.debug('Webtorrent process:', data.toString()) + }) + } webtorrent.app = webtorrent_process }) -- cgit v1.2.3