Electron-log setup

This commit is contained in:
Core 2022-02-04 03:33:49 +00:00
parent e9b960f71f
commit 1a1842ad41
No known key found for this signature in database
GPG key ID: FE9BF1B547F8F3C6

View file

@ -1,6 +1,7 @@
import {app, Menu, nativeImage, Tray} from 'electron';
import * as path from 'path';
import {utils} from './utils'
import * as log from 'electron-log';
import {utils} from './utils';
export class AppEvents {
private protocols: string[] = [
@ -24,6 +25,7 @@ export class AppEvents {
* @returns {void}
*/
private start(): void {
AppEvents.initLogging()
console.info('[AppEvents] App started');
/**********************************************************************************************************************
@ -284,4 +286,13 @@ export class AppEvents {
])
this.tray.setContextMenu(menu)
}
/**
* Initializes logging in the application
* @private
*/
private static initLogging() {
log.transports.console.format = '[{h}:{i}:{s}.{ms}] [{level}] {text}';
Object.assign(console, log.functions);
}
}