aboutsummaryrefslogtreecommitdiff
path: root/ext/js/pages/settings
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/pages/settings')
-rw-r--r--ext/js/pages/settings/anki-controller.js5
-rw-r--r--ext/js/pages/settings/backup-controller.js20
-rw-r--r--ext/js/pages/settings/dictionary-controller.js2
-rw-r--r--ext/js/pages/settings/dictionary-import-controller.js2
4 files changed, 11 insertions, 18 deletions
diff --git a/ext/js/pages/settings/anki-controller.js b/ext/js/pages/settings/anki-controller.js
index e161d86b..ecee1788 100644
--- a/ext/js/pages/settings/anki-controller.js
+++ b/ext/js/pages/settings/anki-controller.js
@@ -19,7 +19,7 @@
import {AnkiConnect} from '../../comm/anki-connect.js';
import {EventListenerCollection} from '../../core/event-listener-collection.js';
import {ExtensionError} from '../../core/extension-error.js';
-import {log} from '../../core/logger.js';
+import {log} from '../../core/log.js';
import {toError} from '../../core/to-error.js';
import {getStandardFieldMarkers} from '../../data/anki-template-util.js';
import {stringContainsAnyFieldMarker} from '../../data/anki-util.js';
@@ -205,8 +205,7 @@ export class AnkiController {
/** */
_onAnkiErrorLogLinkClick() {
if (this._ankiError === null) { return; }
- // eslint-disable-next-line no-console
- console.log({error: this._ankiError});
+ log.log({error: this._ankiError});
}
/**
diff --git a/ext/js/pages/settings/backup-controller.js b/ext/js/pages/settings/backup-controller.js
index 2bab00e3..18991140 100644
--- a/ext/js/pages/settings/backup-controller.js
+++ b/ext/js/pages/settings/backup-controller.js
@@ -18,7 +18,7 @@
import {Dexie} from '../../../lib/dexie.js';
import {parseJson} from '../../core/json.js';
-import {log} from '../../core/logger.js';
+import {log} from '../../core/log.js';
import {toError} from '../../core/to-error.js';
import {isObject} from '../../core/utilities.js';
import {OptionsUtil} from '../../data/options-util.js';
@@ -557,16 +557,14 @@ export class BackupController {
* @param {{totalRows: number, completedRows: number, done: boolean}} details
*/
_databaseExportProgressCallback({totalRows, completedRows, done}) {
- // eslint-disable-next-line no-console
- console.log(`Progress: ${completedRows} of ${totalRows} rows completed`);
+ log.log(`Progress: ${completedRows} of ${totalRows} rows completed`);
/** @type {HTMLElement} */
const messageContainer = querySelectorNotNull(document, '#db-ops-progress-report');
messageContainer.style.display = 'block';
messageContainer.textContent = `Export Progress: ${completedRows} of ${totalRows} rows completed`;
if (done) {
- // eslint-disable-next-line no-console
- console.log('Done exporting.');
+ log.log('Done exporting.');
messageContainer.style.display = 'none';
}
}
@@ -607,8 +605,7 @@ export class BackupController {
const blob = new Blob([data], {type: 'application/json'});
this._saveBlob(blob, fileName);
} catch (error) {
- // eslint-disable-next-line no-console
- console.log(error);
+ log.log(error);
this._databaseExportImportErrorMessage('Errors encountered while exporting. Please try again. Restart the browser if it continues to fail.');
} finally {
pageExitPrevention.end();
@@ -622,8 +619,7 @@ export class BackupController {
* @param {{totalRows: number, completedRows: number, done: boolean}} details
*/
_databaseImportProgressCallback({totalRows, completedRows, done}) {
- // eslint-disable-next-line no-console
- console.log(`Progress: ${completedRows} of ${totalRows} rows completed`);
+ log.log(`Progress: ${completedRows} of ${totalRows} rows completed`);
/** @type {HTMLElement} */
const messageContainer = querySelectorNotNull(document, '#db-ops-progress-report');
messageContainer.style.display = 'block';
@@ -631,8 +627,7 @@ export class BackupController {
messageContainer.textContent = `Import Progress: ${completedRows} of ${totalRows} rows completed`;
if (done) {
- // eslint-disable-next-line no-console
- console.log('Done importing.');
+ log.log('Done importing.');
messageContainer.style.color = '#006633';
messageContainer.textContent = 'Done importing. You will need to re-enable the dictionaries and refresh afterward. If you run into issues, please restart the browser. If it continues to fail, reinstall Yomitan and import dictionaries one-by-one.';
}
@@ -685,8 +680,7 @@ export class BackupController {
this._settingsExportDatabaseToken = token;
await this._importDatabase(this._dictionariesDatabaseName, file);
} catch (error) {
- // eslint-disable-next-line no-console
- console.log(error);
+ log.log(error);
/** @type {HTMLElement} */
const messageContainer = querySelectorNotNull(document, '#db-ops-progress-report');
messageContainer.style.color = 'red';
diff --git a/ext/js/pages/settings/dictionary-controller.js b/ext/js/pages/settings/dictionary-controller.js
index 5020dc7c..66ff0923 100644
--- a/ext/js/pages/settings/dictionary-controller.js
+++ b/ext/js/pages/settings/dictionary-controller.js
@@ -17,7 +17,7 @@
*/
import {EventListenerCollection} from '../../core/event-listener-collection.js';
-import {log} from '../../core/logger.js';
+import {log} from '../../core/log.js';
import {DictionaryWorker} from '../../dictionary/dictionary-worker.js';
import {querySelectorNotNull} from '../../dom/query-selector.js';
diff --git a/ext/js/pages/settings/dictionary-import-controller.js b/ext/js/pages/settings/dictionary-import-controller.js
index 34e21c5d..f44ef380 100644
--- a/ext/js/pages/settings/dictionary-import-controller.js
+++ b/ext/js/pages/settings/dictionary-import-controller.js
@@ -17,7 +17,7 @@
*/
import {ExtensionError} from '../../core/extension-error.js';
-import {log} from '../../core/logger.js';
+import {log} from '../../core/log.js';
import {toError} from '../../core/to-error.js';
import {DictionaryWorker} from '../../dictionary/dictionary-worker.js';
import {querySelectorNotNull} from '../../dom/query-selector.js';