Add some logging useful in debugging #1373

Ended up helping diagnose the problem in the end!
This commit is contained in:
Alex Crichton
2019-03-21 08:30:30 -07:00
parent d49d8c9e1b
commit 12355ce81c
2 changed files with 9 additions and 5 deletions

View File

@ -477,6 +477,7 @@ fn extract_programs<'a>(
continue;
}
to_remove.push(i);
log::debug!("custom section {} looks like a wasm bindgen section", i);
program_storage.push(mem::replace(&mut custom.value, Vec::new()));
}
@ -532,6 +533,7 @@ to open an issue at https://github.com/rustwasm/wasm-bindgen/issues!
);
}
let next = get_remaining(&mut payload).unwrap();
log::debug!("found a program of length {}", next.len());
ret.push(<decode::Program as decode::Decode>::decode_all(next));
}
}
@ -561,6 +563,7 @@ fn verify_schema_matches<'a>(data: &'a [u8]) -> Result<Option<&'a str>, Error> {
Ok(s) => s,
Err(_) => bad!(),
};
log::debug!("found version specifier {}", data);
if !data.starts_with("{") || !data.ends_with("}") {
bad!()
}