Skip to content

Commit 9e75005

Browse files
authored
Some small Improvments + Update to egui 0.32 (#34)
* use impl ToString instead of String in enable_category * update egui to 0.32 It seems that egui_puffin doen't get regulary updated anymore maybe the puffin feature should be removed * remove deprecated functions also change version to 0.8.0 instead of 0.7.1 * update to a diffrent egui_puffin patch
1 parent ee22092 commit 9e75005

File tree

4 files changed

+8
-34
lines changed

4 files changed

+8
-34
lines changed

Cargo.toml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "egui_logger"
3-
version = "0.7.0"
3+
version = "0.8.0"
44
edition = "2021"
55
authors = ["Jacob <RegenJacob@gmx.de>"]
66
license = "MIT"
@@ -15,12 +15,12 @@ puffin = ["dep:puffin"]
1515

1616
[dependencies]
1717
log = "0.4"
18-
egui = "0.31"
18+
egui = "0.32"
1919
regex = "1.11"
2020
puffin = { version = "0.19", optional = true }
2121

2222
[dev-dependencies]
23-
eframe = "0.31"
23+
eframe = "0.32"
2424
multi_log = "0.1"
2525
env_logger = "0.11"
2626
puffin_egui = { version = "0.29.0" }
@@ -33,5 +33,4 @@ chrono = { version = "0.4", default-features = false, features = ["alloc", "cloc
3333

3434
[patch.crates-io]
3535
# It seems that puffin and puffin_egui are really outdated
36-
puffin = { git = "https://github.com/tedsteen/puffin", branch = "upgrade-egui" }
37-
puffin_egui = { git = "https://github.com/tedsteen/puffin", branch = "upgrade-egui" }
36+
puffin_egui = { git = "https://github.com/EmbarkStudios/puffin.git", rev = "refs/pull/244/head" }

examples/hello.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ impl eframe::App for MyApp {
4141
.max_log_length(2000) // sets maximum log messages to be retained, default is 1000
4242
// Since we set "show_all_categories" to false in `main`, we should enable some
4343
// categories to be shown by default.
44-
.enable_category("hello".into(), true)
45-
.enable_category("egui_glow::painter".into(), true)
44+
.enable_category("hello", true)
45+
.enable_category("egui_glow::painter", true)
4646
.show(ui)
4747
});
4848
}

src/lib.rs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -117,31 +117,6 @@ impl log::Log for EguiLogger {
117117
fn flush(&self) {}
118118
}
119119

120-
/// Initializes the global logger.
121-
/// Should be called very early in the program.
122-
/// Defaults to max level Debug.
123-
///
124-
/// This is now deprecated, use [`builder()`] instead.
125-
#[deprecated(
126-
since = "0.5.0",
127-
note = "Please use `egui_logger::builder().init()` instead"
128-
)]
129-
pub fn init() -> Result<(), SetLoggerError> {
130-
builder().init()
131-
}
132-
133-
/// Same as [`init()`] accepts a [`log::LevelFilter`] to set the max level
134-
/// use [`Trace`](log::LevelFilter::Trace) with caution
135-
///
136-
/// This is now deprecated, use [`builder()`] instead.
137-
#[deprecated(
138-
since = "0.5.0",
139-
note = "Please use `egui_logger::builder().max_level(max_level).init()` instead"
140-
)]
141-
pub fn init_with_max_level(max_level: log::LevelFilter) -> Result<(), SetLoggerError> {
142-
builder().max_level(max_level).init()
143-
}
144-
145120
struct Record {
146121
level: log::Level,
147122
message: String,

src/ui.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,13 +222,13 @@ impl LoggerUi {
222222
/// # Panics
223223
/// Panics if the lock to the logger could not be acquired.
224224
#[inline]
225-
pub fn enable_category(self, category: String, enable: bool) -> Self {
225+
pub fn enable_category(self, category: impl ToString, enable: bool) -> Self {
226226
LOGGER
227227
.lock()
228228
.as_mut()
229229
.expect("could not lock LOGGER")
230230
.categories
231-
.insert(category, enable);
231+
.insert(category.to_string(), enable);
232232
self
233233
}
234234

0 commit comments

Comments
 (0)