summaryrefslogtreecommitdiff
path: root/ext/js/settings
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-02-14 17:52:01 -0500
committerGitHub <noreply@github.com>2021-02-14 17:52:01 -0500
commit9279ced68660610764931da681f22c8b71bf1b6e (patch)
tree2a4d015cf57adfe74af72615bad19c9308388e99 /ext/js/settings
parent286534e648af350d24fbf3c7892a7ec81aaeb4bd (diff)
Log refactoring (#1393)
* Create Logger class and log instance * Replace yomichan.logWarning with log.warn * Replace yomichan.logError with log.error * Replace yomichan.log with log.log * Update the Yomichan class to use the global log object * Update lint rules
Diffstat (limited to 'ext/js/settings')
-rw-r--r--ext/js/settings/anki-controller.js2
-rw-r--r--ext/js/settings/backup-controller.js4
-rw-r--r--ext/js/settings/dictionary-controller.js2
-rw-r--r--ext/js/settings/dictionary-import-controller.js2
-rw-r--r--ext/js/settings/main.js2
-rw-r--r--ext/js/settings/pitch-accents-preview-main.js2
-rw-r--r--ext/js/settings/popup-preview-frame-main.js2
-rw-r--r--ext/js/settings/settings-main.js2
8 files changed, 9 insertions, 9 deletions
diff --git a/ext/js/settings/anki-controller.js b/ext/js/settings/anki-controller.js
index db3e3c14..26cab68f 100644
--- a/ext/js/settings/anki-controller.js
+++ b/ext/js/settings/anki-controller.js
@@ -638,7 +638,7 @@ class AnkiCardController {
try {
await this._settingsController.permissionsUtil.setPermissionsGranted({permissions}, true);
} catch (e) {
- yomichan.logError(e);
+ log.error(e);
}
}
diff --git a/ext/js/settings/backup-controller.js b/ext/js/settings/backup-controller.js
index 117f2422..649645d4 100644
--- a/ext/js/settings/backup-controller.js
+++ b/ext/js/settings/backup-controller.js
@@ -173,7 +173,7 @@ class BackupController {
}
_showSettingsImportError(error) {
- yomichan.logError(error);
+ log.error(error);
document.querySelector('#settings-import-error-message').textContent = `${error}`;
this._settingsImportErrorModal.setVisible(true);
}
@@ -412,7 +412,7 @@ class BackupController {
try {
await this._settingsImportSetOptionsFull(optionsFull);
} catch (e) {
- yomichan.logError(e);
+ log.error(e);
}
}
}
diff --git a/ext/js/settings/dictionary-controller.js b/ext/js/settings/dictionary-controller.js
index 78173202..e12017f2 100644
--- a/ext/js/settings/dictionary-controller.js
+++ b/ext/js/settings/dictionary-controller.js
@@ -476,7 +476,7 @@ class DictionaryController {
await this._deleteDictionaryInternal(dictionaryTitle, onProgress);
await this._deleteDictionarySettings(dictionaryTitle);
} catch (e) {
- yomichan.logError(e);
+ log.error(e);
} finally {
prevention.end();
for (const progress of progressContainers) { progress.hidden = true; }
diff --git a/ext/js/settings/dictionary-import-controller.js b/ext/js/settings/dictionary-import-controller.js
index 00eb7b95..1389b7f0 100644
--- a/ext/js/settings/dictionary-import-controller.js
+++ b/ext/js/settings/dictionary-import-controller.js
@@ -253,7 +253,7 @@ class DictionaryImportController {
_showErrors(errors) {
const uniqueErrors = new Map();
for (const error of errors) {
- yomichan.logError(error);
+ log.error(error);
const errorString = this._errorToString(error);
let count = uniqueErrors.get(errorString);
if (typeof count === 'undefined') {
diff --git a/ext/js/settings/main.js b/ext/js/settings/main.js
index 51cd5f27..9785ee0e 100644
--- a/ext/js/settings/main.js
+++ b/ext/js/settings/main.js
@@ -104,6 +104,6 @@ async function setupEnvironmentInfo() {
yomichan.ready();
} catch (e) {
- yomichan.logError(e);
+ log.error(e);
}
})();
diff --git a/ext/js/settings/pitch-accents-preview-main.js b/ext/js/settings/pitch-accents-preview-main.js
index fe3bd36d..d9d56727 100644
--- a/ext/js/settings/pitch-accents-preview-main.js
+++ b/ext/js/settings/pitch-accents-preview-main.js
@@ -30,6 +30,6 @@
await displayGenerator.prepare();
displayGenerator.preparePitchAccents();
} catch (e) {
- yomichan.logError(e);
+ log.error(e);
}
})();
diff --git a/ext/js/settings/popup-preview-frame-main.js b/ext/js/settings/popup-preview-frame-main.js
index a62e8d28..80e248be 100644
--- a/ext/js/settings/popup-preview-frame-main.js
+++ b/ext/js/settings/popup-preview-frame-main.js
@@ -38,6 +38,6 @@
document.documentElement.dataset.loaded = 'true';
} catch (e) {
- yomichan.logError(e);
+ log.error(e);
}
})();
diff --git a/ext/js/settings/settings-main.js b/ext/js/settings/settings-main.js
index a5bb642c..273142cd 100644
--- a/ext/js/settings/settings-main.js
+++ b/ext/js/settings/settings-main.js
@@ -149,6 +149,6 @@ async function setupGenericSettingsController(genericSettingController) {
const settingsDisplayController = new SettingsDisplayController(settingsController, modalController);
settingsDisplayController.prepare();
} catch (e) {
- yomichan.logError(e);
+ log.error(e);
}
})();