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 {app, Menu, nativeImage, Tray} from 'electron';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import {utils} from './utils'
|
import * as log from 'electron-log';
|
||||||
|
import {utils} from './utils';
|
||||||
|
|
||||||
export class AppEvents {
|
export class AppEvents {
|
||||||
private protocols: string[] = [
|
private protocols: string[] = [
|
||||||
|
@ -24,6 +25,7 @@ export class AppEvents {
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
private start(): void {
|
private start(): void {
|
||||||
|
AppEvents.initLogging()
|
||||||
console.info('[AppEvents] App started');
|
console.info('[AppEvents] App started');
|
||||||
|
|
||||||
/**********************************************************************************************************************
|
/**********************************************************************************************************************
|
||||||
|
@ -284,4 +286,13 @@ export class AppEvents {
|
||||||
])
|
])
|
||||||
this.tray.setContextMenu(menu)
|
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