From: Ian Jackson Date: Tue, 29 Dec 2020 02:10:20 +0000 (+0000) Subject: plumb log through, it works now! X-Git-Tag: otter-0.2.0~91 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=59661bf118cb24ac9f9e4b489353d30f1f8cbea9;p=otter.git plumb log through, it works now! Signed-off-by: Ian Jackson --- diff --git a/templates/log-save.js b/templates/log-save.js new file mode 100644 index 00000000..b192043f --- /dev/null +++ b/templates/log-save.js @@ -0,0 +1,19 @@ + diff --git a/wdriver.rs b/wdriver.rs index 2da630d4..0b4c0dcc 100644 --- a/wdriver.rs +++ b/wdriver.rs @@ -544,6 +544,8 @@ bundled_sources = "@target@/bundled-sources" wasm_dir = "@target@/packed-wasm" shapelibs = [ "@src@/library/*.toml" ] +debug_js_inject_file = "@src@/templates/log-save.js" + [log] global_level = 'debug' @@ -665,26 +667,6 @@ fn prepare_thirtyfour() -> (T4d, ScreenShotCount, Vec) { driver.get(URL).context("navigate to front page")?; screenshot(&mut driver, &mut count, "front")?; - driver.execute_script(r#" - orig_console = window.console; - window.console = (function(){ - var saved = [ ]; - var new_console = { saved: saved}; - for (k of ['log','error','warn','info']) { - (function(k){ - var orig = orig_console[k]; - new_console[k] = function() { - saved.push([k, arguments]); - orig.apply(orig_console, arguments); - } - })(k); - } - return new_console; - })(); - - console.log('wdriver.rs console log starts'); - "#)?; - fetch_log(&driver, "front")?; let t = Some(5_000 * MS);