[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:
@@ -48,6 +48,7 @@ const defaultPreferences: ConfigV3 = {
|
|||||||
lastActiveTeam: 0,
|
lastActiveTeam: 0,
|
||||||
downloadLocation: getDefaultDownloadLocation(),
|
downloadLocation: getDefaultDownloadLocation(),
|
||||||
startInFullscreen: false,
|
startInFullscreen: false,
|
||||||
|
logLevel: 'info',
|
||||||
};
|
};
|
||||||
|
|
||||||
export default defaultPreferences;
|
export default defaultPreferences;
|
||||||
|
@@ -10,6 +10,14 @@ jest.unmock('common/log');
|
|||||||
|
|
||||||
jest.mock('electron-log', () => ({
|
jest.mock('electron-log', () => ({
|
||||||
log: jest.fn(),
|
log: jest.fn(),
|
||||||
|
transports: {
|
||||||
|
file: {
|
||||||
|
level: 'info',
|
||||||
|
},
|
||||||
|
console: {
|
||||||
|
level: 'info',
|
||||||
|
},
|
||||||
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
jest.mock('common/utils/util', () => ({
|
jest.mock('common/utils/util', () => ({
|
||||||
|
@@ -22,6 +22,9 @@ export class Logger {
|
|||||||
|
|
||||||
constructor(...prefixes: string[]) {
|
constructor(...prefixes: string[]) {
|
||||||
this.prefixes = this.shortenPrefixes(...prefixes);
|
this.prefixes = this.shortenPrefixes(...prefixes);
|
||||||
|
|
||||||
|
// Start on info by default
|
||||||
|
setLoggingLevel('info');
|
||||||
}
|
}
|
||||||
|
|
||||||
withPrefix = (...prefixes: string[]) => {
|
withPrefix = (...prefixes: string[]) => {
|
||||||
|
Reference in New Issue
Block a user