[MM-54170] Automatically set the logging level to info if not specified (#2811)

* [MM-54170] Automatically set the logging level to info if not specified

* Fix test
This commit is contained in:
Devin Binnie 2023-09-01 11:52:11 -04:00 committed by GitHub
parent 80fcbf27c3
commit 06872452f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 0 deletions

View file

@ -48,6 +48,7 @@ const defaultPreferences: ConfigV3 = {
lastActiveTeam: 0,
downloadLocation: getDefaultDownloadLocation(),
startInFullscreen: false,
logLevel: 'info',
};
export default defaultPreferences;

View file

@ -10,6 +10,14 @@ jest.unmock('common/log');
jest.mock('electron-log', () => ({
log: jest.fn(),
transports: {
file: {
level: 'info',
},
console: {
level: 'info',
},
},
}));
jest.mock('common/utils/util', () => ({

View file

@ -22,6 +22,9 @@ export class Logger {
constructor(...prefixes: string[]) {
this.prefixes = this.shortenPrefixes(...prefixes);
// Start on info by default
setLoggingLevel('info');
}
withPrefix = (...prefixes: string[]) => {