summaryrefslogtreecommitdiff
path: root/ext/js/background/backend.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/background/backend.js')
-rw-r--r--ext/js/background/backend.js19
1 files changed, 3 insertions, 16 deletions
diff --git a/ext/js/background/backend.js b/ext/js/background/backend.js
index df4b9777..a4cf6949 100644
--- a/ext/js/background/backend.js
+++ b/ext/js/background/backend.js
@@ -342,8 +342,9 @@ export class Backend {
* @param {{level: import('log').LogLevel}} params
*/
_onLog({level}) {
- const levelValue = this._getErrorLevelValue(level);
- if (levelValue <= this._getErrorLevelValue(this._logErrorLevel)) { return; }
+ const levelValue = log.getLogErrorLevelValue(level);
+ const currentLogErrorLevel = this._logErrorLevel !== null ? log.getLogErrorLevelValue(this._logErrorLevel) : 0;
+ if (levelValue <= currentLogErrorLevel) { return; }
this._logErrorLevel = level;
this._updateBadge();
@@ -1452,20 +1453,6 @@ export class Backend {
}
/**
- * @param {?import('log').LogLevel} errorLevel
- * @returns {number}
- */
- _getErrorLevelValue(errorLevel) {
- switch (errorLevel) {
- case 'info': return 0;
- case 'debug': return 0;
- case 'warn': return 1;
- case 'error': return 2;
- default: return 0;
- }
- }
-
- /**
* @param {import('settings-modifications').OptionsScope} target
* @returns {import('settings').Options|import('settings').ProfileOptions}
* @throws {Error}