1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-02 14:50:03 -04:00

Replace tracing with log (#2928)

* Replace tracing crate with log

It's just so much simpler to use

* Add `bacon wasm` job

* eframe: add a WebLogger for piping log events to the web console
This commit is contained in:
Emil Ernerfeldt
2023-04-18 21:11:26 +02:00
committed by GitHub
parent 0f9e1a3526
commit 9c9a54ce36
48 changed files with 477 additions and 291 deletions

View File

@@ -57,6 +57,9 @@ extra_debug_asserts = [
## Always enable additional checks.
extra_asserts = ["emath/extra_asserts", "ecolor/extra_asserts"]
## Turn on the `log` feature, that makes egui log some errors using the [`log`](https://docs.rs/log) crate.
log = ["dep:log"]
## [`mint`](https://docs.rs/mint) enables interoperability with other math libraries such as [`glam`](https://docs.rs/glam) and [`nalgebra`](https://docs.rs/nalgebra).
mint = ["emath/mint"]
@@ -83,6 +86,8 @@ bytemuck = { version = "1.7.2", optional = true, features = ["derive"] }
## Enable this when generating docs.
document-features = { version = "0.2", optional = true }
log = { version = "0.4", optional = true, features = ["std"] }
## Allow serialization using [`serde`](https://docs.rs/serde) .
serde = { version = "1", optional = true, features = ["derive", "rc"] }

View File

@@ -217,8 +217,8 @@ impl TextureAtlas {
if required_height > self.max_height() {
// This is a bad place to be - we need to start reusing space :/
#[cfg(feature = "tracing")]
tracing::wan!("epaint texture atlas overflowed!");
#[cfg(feature = "log")]
log::warn!("epaint texture atlas overflowed!");
self.cursor = (0, self.image.height() / 3); // Restart a bit down - the top of the atlas has too many important things in it
self.overflowed = true; // this will signal the user that we need to recreate the texture atlas next frame.