Electron-log setup
This commit is contained in:
parent
e9b960f71f
commit
1a1842ad41
1 changed files with 12 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue