stevenarella/src
iceiix fd7add3f17
wasm: log output to browser JavaScript console (#163)
Logging from the `log` facade goes to the colorized in-game GUI console (opened with the backtick key), as well as standard output using `println!` on the native build. To make this work on the wasm build, web-sys is used to access the `console` object, to call `console.log`, `console.warn`, and so on corresponding to the log levels. Extends #92, fails later (see also #115) but now outputs the starting up message:

[main.rs:206][INFO] Starting steven

* Add println! logging to console.log on wasm

* Initialize logger before config (called 'console variables' for some reason) to avoid having to disable it to reach the first logging statement

* Add web-sys crate for browser console access, wasm32-only

* Refactor logger to call println_level on both web/native

* Add multiple log levels, console.warn etc., matching console_log crate

https://github.com/iamcodemaker/console_log#details
2019-05-22 16:12:43 -07:00
..
console wasm: log output to browser JavaScript console (#163) 2019-05-22 16:12:43 -07:00
ecs Use field init shorthand, instead of x:x, just x, 2018-11-04 13:43:30 -08:00
entity Replace println! with log crate facade macros info!, debug!, etc. 2019-05-22 16:01:14 -07:00
gl Replace println! with log crate facade macros info!, debug!, etc. 2019-05-22 16:01:14 -07:00
model Update to rand 0.6.5 and migrate off deprecated methods. Closes #81 2019-05-08 19:32:05 -07:00
nbt Replace read_to_string -> read_to_end to improve UTF-8 deserialization 2019-05-12 14:08:53 -07:00
protocol Replace println! with log crate facade macros info!, debug!, etc. 2019-05-22 16:01:14 -07:00
render Replace println! with log crate facade macros info!, debug!, etc. 2019-05-22 16:01:14 -07:00
screen Add Forge handshake support. Closes #88 (#134) 2019-05-05 18:39:58 -07:00
server Replace println! with log crate facade macros info!, debug!, etc. 2019-05-22 16:01:14 -07:00
types 1.14 protocol support (477) (#132). Closes #72 2019-05-04 16:04:19 -07:00
ui Update to rand 0.6.5 and migrate off deprecated methods. Closes #81 2019-05-08 19:32:05 -07:00
world Add support for a modded block: rockwool from Thermal Expansion (#153) 2019-05-15 12:49:57 -07:00
auth.rs Update to use crate:: for current crate, for Rust 2018 edition 2018-11-04 12:06:00 -08:00
chunk_builder.rs Update to rand 0.6.5 and migrate off deprecated methods. Closes #81 2019-05-08 19:32:05 -07:00
format.rs Recognize translate text components, instead of showing "UNHANDLED" 2018-12-02 19:25:11 -08:00
item.rs 1.13.2 (404) multiprotocol support (#67) 2018-12-28 21:22:58 -08:00
macros.rs Base implementation for worlds/blocks 2016-03-18 22:24:30 +00:00
main.rs wasm: log output to browser JavaScript console (#163) 2019-05-22 16:12:43 -07:00
resources.rs Add support for compiling WebAssembly wasm32-unknown-unknown target (#92) 2019-03-03 08:32:36 -08:00
settings.rs Add double-jump to toggle creative flight. Closes #46 2019-01-26 13:00:19 -08:00