Use ELECTRON_ENABLE_LOGGING=true
.
index.js
:
const { app, BrowserWindow } = require('electron');
function createWindow () {
let win = new BrowserWindow({
show: false
});
win.loadFile('index.html');
}
app.on('ready', createWindow);
index.html
:
<!doctype html>
<html>
<body>
<script>
console.log('test');
</script>
</body>
</html>
$ echo {} > package.json
$ npm i electron
$ npx electron .
[1508635:1207/122734.081064:ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command
$ ELECTRON_ENABLE_LOGGING=true npx electron .
[1509121:1207/122800.446651:ERROR:sandbox_linux.cc(369)] InitializeSandbox() called with multiple threads in process gpu-process.
[1509121:1207/122800.470487:ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command
[1509084:1207/122800.538143:INFO:CONSOLE(6)] "test", source: file:///home/yuri/_/5/index.html (6)
[1509084:1207/122800.543453:INFO:CONSOLE(2854)] "%cElectron Security Warning (Insecure Content-Security-Policy) font-weight: bold; This renderer process has either no Content Security
Policy set or a policy with "unsafe-eval" enabled. This exposes users of
this app to unnecessary security risks.
For more information and help, consult
https://electronjs.org/docs/tutorial/security.
This warning will not show up
once the app is packaged.", source: electron/js2c/renderer_init.js (2854)