diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-05-11 20:43:07 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-05-13 14:23:11 +0200 |
commit | 09bc69df7a82ff7c7a3bc4d8c9feef8a64a7c517 (patch) | |
tree | 749d91ec074bc1a90c29c53368fc705c89b607bb /server/lib/webtorrent.js | |
parent | 504b79cb6753c9b4fb48875a205afc8fd9b8e353 (diff) | |
download | PeerTube-09bc69df7a82ff7c7a3bc4d8c9feef8a64a7c517.tar.gz PeerTube-09bc69df7a82ff7c7a3bc4d8c9feef8a64a7c517.tar.zst PeerTube-09bc69df7a82ff7c7a3bc4d8c9feef8a64a7c517.zip |
Add debug electron setting
Diffstat (limited to 'server/lib/webtorrent.js')
-rw-r--r-- | server/lib/webtorrent.js | 16 |
1 files changed, 10 insertions, 6 deletions
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') | |||
7 | 7 | ||
8 | const logger = require('../helpers/logger') | 8 | const logger = require('../helpers/logger') |
9 | 9 | ||
10 | const electron_debug = config.get('electron.debug') | ||
10 | let host = config.get('webserver.host') | 11 | let host = config.get('webserver.host') |
11 | let port = config.get('webserver.port') | 12 | let port = config.get('webserver.port') |
12 | let nodeKey = 'webtorrentnode' + port | 13 | let nodeKey = 'webtorrentnode' + port |
@@ -57,13 +58,16 @@ function create (options, callback) { | |||
57 | }) | 58 | }) |
58 | 59 | ||
59 | const webtorrent_process = spawn(pathUtils.join(__dirname, 'webtorrentProcess.js'), host, port, { detached: true }) | 60 | const webtorrent_process = spawn(pathUtils.join(__dirname, 'webtorrentProcess.js'), host, port, { detached: true }) |
60 | webtorrent_process.stderr.on('data', function (data) { | ||
61 | // logger.debug('Webtorrent process stderr: ', data.toString()) | ||
62 | }) | ||
63 | 61 | ||
64 | webtorrent_process.stdout.on('data', function (data) { | 62 | if (electron_debug === true) { |
65 | // logger.debug('Webtorrent process:', data.toString()) | 63 | webtorrent_process.stderr.on('data', function (data) { |
66 | }) | 64 | logger.debug('Webtorrent process stderr: ', data.toString()) |
65 | }) | ||
66 | |||
67 | webtorrent_process.stdout.on('data', function (data) { | ||
68 | logger.debug('Webtorrent process:', data.toString()) | ||
69 | }) | ||
70 | } | ||
67 | 71 | ||
68 | webtorrent.app = webtorrent_process | 72 | webtorrent.app = webtorrent_process |
69 | }) | 73 | }) |