[MM-51873] Create central logging module for adding prefixes to differentiate logs between modules (#2652)

* Create central logging module for adding prefixes to differentiate logs between modules

* Turn logger into class

* Merge'd

* Rework to use class more intelligently

* Fix modalView

* Fix webContentEvents

* Update src/main/app/intercom.ts

Co-authored-by: Daniel Espino García <larkox@gmail.com>

* Shorten prefixes on object creation

---------

Co-authored-by: Daniel Espino García <larkox@gmail.com>
This commit is contained in:
Devin Binnie
2023-04-05 12:09:56 -04:00
committed by GitHub
parent 865b00625e
commit 245215c678
42 changed files with 409 additions and 240 deletions

View File

@@ -1,14 +1,17 @@
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import log from 'electron-log';
import {Certificate, WebContents} from 'electron';
import {CertificateModalData} from 'types/certificate';
import {Logger} from 'common/log';
import modalManager from './views/modalManager';
import {getLocalURLString, getLocalPreload} from './utils';
import MainWindow from './windows/mainWindow';
const log = new Logger('CertificateManager');
const preload = getLocalPreload('desktopAPI.js');
const html = getLocalURLString('certificateModal.html');
@@ -24,7 +27,7 @@ export class CertificateManager {
}
handleSelectCertificate = (event: Event, webContents: WebContents, url: string, list: Certificate[], callback: (certificate?: Certificate | undefined) => void) => {
log.verbose('CertificateManager.handleSelectCertificate', url, list);
log.verbose('handleSelectCertificate', url, list);
if (list.length > 1) {
event.preventDefault(); // prevent the app from getting the first certificate available