diff options
author | stephan <stephan@noemail.net> | 2023-02-06 14:01:19 +0000 |
---|---|---|
committer | stephan <stephan@noemail.net> | 2023-02-06 14:01:19 +0000 |
commit | 3ff812aa94644dc60bda6933de8b4870d9f5cba6 (patch) | |
tree | e368c239e49016b898dc4db1b49f21022e30ee8d /ext/wasm/api/sqlite3-opfs-async-proxy.js | |
parent | ee18659f69d15498f233cb987b7f7db21445f4a4 (diff) | |
download | sqlite-3ff812aa94644dc60bda6933de8b4870d9f5cba6.tar.gz sqlite-3ff812aa94644dc60bda6933de8b4870d9f5cba6.zip |
Add capability to override the JS's use of console.log/debug/warn/error() with client-provided versions via the bootstrap-time config object.
FossilOrigin-Name: c54f29d8e55419eaa9168e799dab5030e89063b13d8390a50616606422d164dc
Diffstat (limited to 'ext/wasm/api/sqlite3-opfs-async-proxy.js')
-rw-r--r-- | ext/wasm/api/sqlite3-opfs-async-proxy.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/wasm/api/sqlite3-opfs-async-proxy.js b/ext/wasm/api/sqlite3-opfs-async-proxy.js index 1456ae08d..b1ad9152e 100644 --- a/ext/wasm/api/sqlite3-opfs-async-proxy.js +++ b/ext/wasm/api/sqlite3-opfs-async-proxy.js @@ -74,9 +74,9 @@ const installAsyncProxy = function(self){ state.verbose = 1; const loggers = { - 0:console.error.bind(console), - 1:console.warn.bind(console), - 2:console.log.bind(console) + 0:sqlite3.config.error.bind(console), + 1:sqlite3.config.warn.bind(console), + 2:sqlite3.config.log.bind(console) }; const logImpl = (level,...args)=>{ if(state.verbose>level) loggers[level]("OPFS asyncer:",...args); @@ -106,12 +106,12 @@ const installAsyncProxy = function(self){ w += m.wait; m.avgTime = (m.count && m.time) ? (m.time / m.count) : 0; } - console.log(self.location.href, + sqlite3.config.log(self.location.href, "metrics for",self.location.href,":\n", metrics, "\nTotal of",n,"op(s) for",t,"ms", "approx",w,"ms spent waiting on OPFS APIs."); - console.log("Serialization metrics:",metrics.s11n); + sqlite3.config.log("Serialization metrics:",metrics.s11n); }; /** @@ -272,7 +272,7 @@ const installAsyncProxy = function(self){ || (e.cause.name==='DOMException' && 0===e.cause.message.indexOf('Access Handles cannot'))) ) ? ( - /*console.warn("SQLITE_BUSY",e),*/ + /*sqlite3.config.warn("SQLITE_BUSY",e),*/ state.sq3Codes.SQLITE_BUSY ) : rc; }else{ |