Echo Writes Code

console.rs

1
2
3
4
5
6
7
pub fn write_line(message: &str) {
  #[cfg(all(target_os = "unknown", target_family = "wasm"))]
  web_sys::console::log_1(&format!("[Crucible] {}", message).into());

  #[cfg(not(all(target_os = "unknown", target_family = "wasm")))]
  println!("[Crucible] {}", message);
}