From 9279ced68660610764931da681f22c8b71bf1b6e Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 14 Feb 2021 17:52:01 -0500 Subject: 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 --- ext/js/language/dictionary-database.js | 2 +- ext/js/language/text-scanner.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'ext/js/language') diff --git a/ext/js/language/dictionary-database.js b/ext/js/language/dictionary-database.js index b363ed25..62c22289 100644 --- a/ext/js/language/dictionary-database.js +++ b/ext/js/language/dictionary-database.js @@ -122,7 +122,7 @@ class DictionaryDatabase { await Database.deleteDatabase(this._dbName); result = true; } catch (e) { - yomichan.logError(e); + log.error(e); } await this.prepare(); return result; diff --git a/ext/js/language/text-scanner.js b/ext/js/language/text-scanner.js index e91498ba..073b1a6c 100644 --- a/ext/js/language/text-scanner.js +++ b/ext/js/language/text-scanner.js @@ -830,7 +830,7 @@ class TextScanner extends EventDispatcher { } } } catch (e) { - yomichan.logError(e); + log.error(e); } finally { this._pendingLookup = false; } -- cgit v1.2.3