mirror of
https://github.com/finos/SymphonyElectron.git
synced 2026-07-29 23:57:56 -05:00
Fix logging issues
This commit is contained in:
@@ -117,10 +117,9 @@ function initializeLocalLogger() {
|
||||
electronLog = require('electron-log');
|
||||
const logPath = app.getPath('logs');
|
||||
cleanupOldLogs(logPath);
|
||||
electronLog.transports.file.file = path.join(logPath, 'app.log');
|
||||
electronLog.transports.file.file = path.join(logPath, `app_${Date.now()}.log`);
|
||||
electronLog.transports.file.level = 'debug';
|
||||
electronLog.transports.file.format = '{y}-{m}-{d} {h}:{i}:{s}:{ms} {z} | {level} | {text}';
|
||||
electronLog.transports.file.maxSize = 10 * 10 * 1024;
|
||||
electronLog.transports.file.appName = 'Symphony';
|
||||
}
|
||||
|
||||
@@ -130,7 +129,7 @@ function initializeLocalLogger() {
|
||||
*/
|
||||
function cleanupOldLogs(logPath) {
|
||||
let files = fs.readdirSync(logPath);
|
||||
const deleteTimeStamp = new Date().getTime() + (10 * 24 * 60 * 60 * 1000)
|
||||
const deleteTimeStamp = new Date().getTime() + (10 * 24 * 60 * 60 * 1000);
|
||||
files.forEach((file) => {
|
||||
if (file === '.DS_Store' || file === 'app.log') {
|
||||
return;
|
||||
|
||||
@@ -139,7 +139,6 @@ function setChromeFlags() {
|
||||
* and set as chrome flags if applicable
|
||||
*/
|
||||
function setChromeFlagsFromCommandLine() {
|
||||
log.send(logLevels.INFO, 'Setting chrome flags from command line args!');
|
||||
|
||||
// Special args that need to be excluded as part of the chrome command line switch
|
||||
let specialArgs = ['--url', '--multiInstance', '--userDataPath=', 'symphony://', '--inspect-brk', '--inspect'];
|
||||
|
||||
@@ -79,8 +79,6 @@ function sanitize(windowName) {
|
||||
*/
|
||||
electron.ipcMain.on(apiName, (event, arg) => {
|
||||
|
||||
log.send(logLevels.INFO, `Processing event for API ${apiName}`);
|
||||
|
||||
if (!isValidWindow(event)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user