mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-13 14:26:37 +00:00
Enabled file logging for the backend process.
Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
parent
daa25794ef
commit
30421f0de4
29
electron/build/patch/main.js
Normal file
29
electron/build/patch/main.js
Normal file
@ -0,0 +1,29 @@
|
||||
// @ts-check
|
||||
const { setup, log } = require('node-log-rotate');
|
||||
setup({
|
||||
appName: 'Arduino Pro IDE',
|
||||
maxSize: 10 * 1024 * 1024
|
||||
});
|
||||
for (const name of ['log', 'trace', 'info', 'warn', 'error']) {
|
||||
const original = console[name];
|
||||
console[name] = (data => {
|
||||
original(data);
|
||||
log(data);
|
||||
}).bind(console);
|
||||
}
|
||||
|
||||
const { BackendApplicationConfigProvider } = require('@theia/core/lib/node/backend-application-config-provider');
|
||||
const main = require('@theia/core/lib/node/main');
|
||||
BackendApplicationConfigProvider.set({
|
||||
"configDirName": ".arduinoProIDE",
|
||||
"singleInstance": true
|
||||
});
|
||||
|
||||
const serverModule = require('./server');
|
||||
const serverAddress = main.start(serverModule());
|
||||
serverAddress.then(function ({ port, address }) {
|
||||
if (process && process.send) {
|
||||
process.send({ port, address });
|
||||
}
|
||||
});
|
||||
module.exports = serverAddress;
|
@ -4,6 +4,9 @@
|
||||
"resolutions": {
|
||||
"**/fs-extra": "^4.0.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"node-log-rotate": "^0.1.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@theia/cli": "next",
|
||||
"cross-env": "^7.0.2",
|
||||
@ -19,7 +22,7 @@
|
||||
"package": "cross-env DEBUG=* && electron-builder --publish=never",
|
||||
"package:publish": "cross-env DEBUG=* && electron-builder --publish=always",
|
||||
"download:plugins": "theia download:plugins",
|
||||
"patch": "ncp ./patch/electron-main.js ./src-gen/frontend/electron-main.js"
|
||||
"patch": "ncp ./patch/electron-main.js ./src-gen/frontend/electron-main.js && ncp ./patch/main.js ./src-gen/backend/main.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10.11.0 <13"
|
||||
|
Loading…
x
Reference in New Issue
Block a user