mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-13 06:16:33 +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": {
|
"resolutions": {
|
||||||
"**/fs-extra": "^4.0.3"
|
"**/fs-extra": "^4.0.3"
|
||||||
},
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"node-log-rotate": "^0.1.5"
|
||||||
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@theia/cli": "next",
|
"@theia/cli": "next",
|
||||||
"cross-env": "^7.0.2",
|
"cross-env": "^7.0.2",
|
||||||
@ -19,7 +22,7 @@
|
|||||||
"package": "cross-env DEBUG=* && electron-builder --publish=never",
|
"package": "cross-env DEBUG=* && electron-builder --publish=never",
|
||||||
"package:publish": "cross-env DEBUG=* && electron-builder --publish=always",
|
"package:publish": "cross-env DEBUG=* && electron-builder --publish=always",
|
||||||
"download:plugins": "theia download:plugins",
|
"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": {
|
"engines": {
|
||||||
"node": ">=10.11.0 <13"
|
"node": ">=10.11.0 <13"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user