minor logging fix and it's launching at least.

still need to test connecting, etc.
This commit is contained in:
Michael Peters 2021-11-22 01:05:14 -06:00
parent ad346fc37d
commit d19c2c49a0
7 changed files with 6 additions and 3 deletions

View File

@ -16,6 +16,9 @@ process.on('unhandledRejection', async (reason: any, _promise: Promise<any>) =>
// Initialize electron remote so that we can get console logs all in the same place // Initialize electron remote so that we can get console logs all in the same place
import * as electronMain from '@electron/remote/main'; import * as electronMain from '@electron/remote/main';
LOG.silly('modules loaded');
electronMain.initialize(); electronMain.initialize();
(async () => { (async () => {
@ -35,7 +38,7 @@ electronMain.initialize();
webPreferences: { webPreferences: {
//@ts-ignore enableRemoteModule is enabled with @electron/remote and not included in electron's typing //@ts-ignore enableRemoteModule is enabled with @electron/remote and not included in electron's typing
enableRemoteModule: true, // so we can get console logs properly enableRemoteModule: true, // so we can get console logs properly
preload: path.join(__dirname, 'webapp', 'entrypoint.js') preload: path.join(__dirname, 'webapp', 'preload.js')
} }
}); });

View File

Before

Width:  |  Height:  |  Size: 639 B

After

Width:  |  Height:  |  Size: 639 B

View File

@ -3,7 +3,7 @@ const electronConsole = electronRemote.getGlobal('console') as Console;
import Logger from '../../logger/logger'; import Logger from '../../logger/logger';
const LOG = Logger.create(__filename, electronConsole); const LOG = Logger.create(__filename, electronConsole);
LOG.silly('script begins'); LOG.silly('preload begins');
import * as path from 'path'; import * as path from 'path';
import * as fs from 'fs/promises'; import * as fs from 'fs/promises';

View File

@ -208,7 +208,7 @@ export default class Logger {
line = NaN; line = NaN;
} }
let prefixFileName = padLeft(fileName, ' ', Math.min(this.longestFileNameLength, MAX_FILE_NAME_PADDING)); let prefixFileName = padLeft(fileName, ' ', MAX_FILE_NAME_PADDING); // Math.min(this.longestFileNameLength, )
let prefixLine = padRight(line + '', ' ', LINE_NUM_LENGTH); let prefixLine = padRight(line + '', ' ', LINE_NUM_LENGTH);
let prefixLogType = colorize(level, LoggerLevel[level].charAt(0).toLowerCase()); let prefixLogType = colorize(level, LoggerLevel[level].charAt(0).toLowerCase());
let prefixTime = moment().format('HH:mm:ss.SSS'); let prefixTime = moment().format('HH:mm:ss.SSS');