Fix logging issues

This commit is contained in:
Vishwas Shashidhar
2019-03-01 20:25:28 +05:30
parent 76812ab854
commit 2e383a8585
3 changed files with 2 additions and 6 deletions
+2 -3
View File
@@ -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;
-1
View File
@@ -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'];
-2
View File
@@ -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;
}