aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Stefan Malzner <stefan@adlk.io>2018-03-18 18:00:57 +0100
committerLibravatar Stefan Malzner <stefan@adlk.io>2018-03-18 18:00:57 +0100
commitf7c25799b13d59b970651bdeb42736bab5b86d15 (patch)
tree5b9bba1f9d2aaf6967ae774c7cc5df8f61a0ece2
parentReplace console logs with debugger (diff)
downloadferdium-app-f7c25799b13d59b970651bdeb42736bab5b86d15.tar.gz
ferdium-app-f7c25799b13d59b970651bdeb42736bab5b86d15.tar.zst
ferdium-app-f7c25799b13d59b970651bdeb42736bab5b86d15.zip
Add debug flags to render process
-rw-r--r--.vscode/launch.json12
-rw-r--r--src/index.html11
2 files changed, 17 insertions, 6 deletions
diff --git a/.vscode/launch.json b/.vscode/launch.json
index fc5cf094e..17d506895 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -10,6 +10,7 @@
10 "protocol": "inspector", 10 "protocol": "inspector",
11 "env": { 11 "env": {
12 "NODE_ENV": "development", 12 "NODE_ENV": "development",
13 "DEBUG": "*,-engine.io*,-socket.io*"
13 } 14 }
14 }, 15 },
15 { 16 {
@@ -21,6 +22,7 @@
21 "protocol": "inspector", 22 "protocol": "inspector",
22 "env": { 23 "env": {
23 "LIVE_API": "1", 24 "LIVE_API": "1",
25 "DEBUG": "*,-engine.io*,-socket.io*"
24 } 26 }
25 }, 27 },
26 { 28 {
@@ -32,6 +34,7 @@
32 "protocol": "inspector", 34 "protocol": "inspector",
33 "env": { 35 "env": {
34 "LOCAL_API": "1", 36 "LOCAL_API": "1",
37 "DEBUG": "*,-engine.io*,-socket.io*"
35 } 38 }
36 }, 39 },
37 { 40 {
@@ -43,7 +46,8 @@
43 "protocol": "inspector", 46 "protocol": "inspector",
44 "env": { 47 "env": {
45 "NODE_ENV": "development", 48 "NODE_ENV": "development",
46 "OS_PLATFORM": "win32" 49 "OS_PLATFORM": "win32",
50 "DEBUG": "*,-engine.io*,-socket.io*"
47 } 51 }
48 }, 52 },
49 { 53 {
@@ -55,7 +59,8 @@
55 "protocol": "inspector", 59 "protocol": "inspector",
56 "env": { 60 "env": {
57 "LIVE_API": "1", 61 "LIVE_API": "1",
58 "OS_PLATFORM": "win32" 62 "OS_PLATFORM": "win32",
63 "DEBUG": "*,-engine.io*,-socket.io*"
59 } 64 }
60 }, 65 },
61 { 66 {
@@ -67,7 +72,8 @@
67 "protocol": "inspector", 72 "protocol": "inspector",
68 "env": { 73 "env": {
69 "LOCAL_API": "1", 74 "LOCAL_API": "1",
70 "OS_PLATFORM": "win32" 75 "OS_PLATFORM": "win32",
76 "DEBUG": "*,-engine.io*,-socket.io*"
71 } 77 }
72 } 78 }
73 ] 79 ]
diff --git a/src/index.html b/src/index.html
index 6c259e5be..5ce7f6a96 100644
--- a/src/index.html
+++ b/src/index.html
@@ -15,6 +15,11 @@
15 15
16 const { isDevMode } = require('./environment'); 16 const { isDevMode } = require('./environment');
17 if (isDevMode) { 17 if (isDevMode) {
18 const debugging = require('debug');
19 debugging.enable(process.env.DEBUG);
20
21 const debug = debugging('Index');
22
18 document.querySelector('body').classList.add('isDevMode'); 23 document.querySelector('body').classList.add('isDevMode');
19 24
20 (function() { 25 (function() {
@@ -25,7 +30,7 @@
25 document.body.appendChild(s); 30 document.body.appendChild(s);
26 31
27 s.onload = () => { 32 s.onload = () => {
28 console.log('livereload loaded'); 33 debug('livereload loaded');
29 const originalReloadBehaviour = window._onLiveReloadFileChanged; 34 const originalReloadBehaviour = window._onLiveReloadFileChanged;
30 35
31 window._onLiveReloadFileChanged = (file) => { 36 window._onLiveReloadFileChanged = (file) => {
@@ -33,10 +38,10 @@
33 originalReloadBehaviour(file); 38 originalReloadBehaviour(file);
34 } else { 39 } else {
35 if (file.path.includes('/build/webview/')) { 40 if (file.path.includes('/build/webview/')) {
36 console.log('Livereload: Reloading all webvies'); 41 debug('Livereload: Reloading all webvies');
37 const webviews = document.querySelectorAll('webview').forEach(webview => webview.reload()); 42 const webviews = document.querySelectorAll('webview').forEach(webview => webview.reload());
38 } else { 43 } else {
39 console.log('Livereload: skip reload as only main process files have changed'); 44 debug('Livereload: skip reload as only main process files have changed');
40 } 45 }
41 } 46 }
42 } 47 }