mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 23:00:04 -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:
@@ -32,8 +32,8 @@ datepicker = ["chrono"]
|
||||
## Support loading svg images.
|
||||
svg = ["resvg", "tiny-skia", "usvg"]
|
||||
|
||||
## Log warnings using `tracing` crate.
|
||||
tracing = ["dep:tracing", "egui/tracing"]
|
||||
## Log warnings using [`log`](https://docs.rs/log) crate.
|
||||
log = ["dep:log", "egui/log"]
|
||||
|
||||
|
||||
[dependencies]
|
||||
@@ -57,12 +57,10 @@ document-features = { version = "0.2", optional = true }
|
||||
## ```
|
||||
image = { version = "0.24", optional = true, default-features = false }
|
||||
|
||||
# feature "log"
|
||||
log = { version = "0.4", optional = true, features = ["std"] }
|
||||
|
||||
# svg feature
|
||||
resvg = { version = "0.28", optional = true, default-features = false }
|
||||
tiny-skia = { version = "0.8", optional = true, default-features = false } # must be updated in lock-step with resvg
|
||||
usvg = { version = "0.28", optional = true, default-features = false }
|
||||
|
||||
# feature "tracing"
|
||||
tracing = { version = "0.1", optional = true, default-features = false, features = [
|
||||
"std",
|
||||
] }
|
||||
|
||||
@@ -28,13 +28,13 @@ pub use crate::sizing::Size;
|
||||
pub use crate::strip::*;
|
||||
pub use crate::table::*;
|
||||
|
||||
/// Log an error with either `tracing` or `eprintln`
|
||||
/// Log an error with either `log` or `eprintln`
|
||||
macro_rules! log_err {
|
||||
($fmt: literal, $($arg: tt)*) => {{
|
||||
#[cfg(feature = "tracing")]
|
||||
tracing::error!($fmt, $($arg)*);
|
||||
#[cfg(feature = "log")]
|
||||
log::error!($fmt, $($arg)*);
|
||||
|
||||
#[cfg(not(feature = "tracing"))]
|
||||
#[cfg(not(feature = "log"))]
|
||||
eprintln!(
|
||||
concat!("egui_extras: ", $fmt), $($arg)*
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user