Remove `log` feature (#7583)
This commit is contained in:
parent
bd45406fad
commit
6579bb910b
|
|
@ -143,14 +143,7 @@ Light Theme:
|
|||
<img src="https://github.com/user-attachments/assets/2e38972c-a444-4894-b32f-47a2719cf369" width="50%">
|
||||
|
||||
## Dependencies
|
||||
`egui` has a minimal set of default dependencies:
|
||||
|
||||
* [`ab_glyph`](https://crates.io/crates/ab_glyph)
|
||||
* [`ahash`](https://crates.io/crates/ahash)
|
||||
* [`bitflags`](https://crates.io/crates/bitflags)
|
||||
* [`nohash-hasher`](https://crates.io/crates/nohash-hasher)
|
||||
* [`parking_lot`](https://crates.io/crates/parking_lot)
|
||||
|
||||
`egui` has a minimal set of default dependencies.
|
||||
Heavier dependencies are kept out of `egui`, even as opt-in.
|
||||
All code in `egui` is Wasm-friendly (even outside a browser).
|
||||
|
||||
|
|
|
|||
|
|
@ -124,10 +124,7 @@ x11 = [
|
|||
__screenshot = []
|
||||
|
||||
[dependencies]
|
||||
egui = { workspace = true, default-features = false, features = [
|
||||
"bytemuck",
|
||||
"log",
|
||||
] }
|
||||
egui = { workspace = true, default-features = false, features = ["bytemuck"] }
|
||||
|
||||
ahash.workspace = true
|
||||
document-features.workspace = true
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ wayland = ["winit/wayland", "bytemuck"]
|
|||
x11 = ["winit/x11", "bytemuck"]
|
||||
|
||||
[dependencies]
|
||||
egui = { workspace = true, default-features = false, features = ["log"] }
|
||||
egui = { workspace = true, default-features = false }
|
||||
|
||||
log.workspace = true
|
||||
profiling.workspace = true
|
||||
|
|
|
|||
|
|
@ -48,9 +48,6 @@ color-hex = ["epaint/color-hex"]
|
|||
## If you plan on specifying your own fonts you may disable this feature.
|
||||
default_fonts = ["epaint/default_fonts"]
|
||||
|
||||
## Turn on the `log` feature, that makes egui log some errors using the [`log`](https://docs.rs/log) crate.
|
||||
log = ["dep:log", "epaint/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 = ["epaint/mint"]
|
||||
|
||||
|
|
@ -80,6 +77,7 @@ epaint = { workspace = true, default-features = false }
|
|||
|
||||
ahash.workspace = true
|
||||
bitflags.workspace = true
|
||||
log.workspace = true
|
||||
nohash-hasher.workspace = true
|
||||
profiling.workspace = true
|
||||
smallvec.workspace = true
|
||||
|
|
@ -93,6 +91,5 @@ backtrace = { workspace = true, optional = true }
|
|||
## Enable this when generating docs.
|
||||
document-features = { workspace = true, optional = true }
|
||||
|
||||
log = { workspace = true, optional = true }
|
||||
ron = { workspace = true, optional = true }
|
||||
serde = { workspace = true, optional = true, features = ["derive", "rc"] }
|
||||
|
|
|
|||
|
|
@ -535,7 +535,7 @@ impl ContextImpl {
|
|||
// New font definition loaded, so we need to reload all fonts.
|
||||
self.fonts = None;
|
||||
self.font_definitions = font_definitions;
|
||||
#[cfg(feature = "log")]
|
||||
|
||||
log::trace!("Loading new font definitions");
|
||||
}
|
||||
|
||||
|
|
@ -559,7 +559,6 @@ impl ContextImpl {
|
|||
.insert(font.name, Arc::new(font.data));
|
||||
}
|
||||
|
||||
#[cfg(feature = "log")]
|
||||
log::trace!("Adding new fonts");
|
||||
}
|
||||
|
||||
|
|
@ -568,7 +567,6 @@ impl ContextImpl {
|
|||
let mut is_new = false;
|
||||
|
||||
let fonts = self.fonts.get_or_insert_with(|| {
|
||||
#[cfg(feature = "log")]
|
||||
log::trace!("Creating new Fonts");
|
||||
|
||||
is_new = true;
|
||||
|
|
@ -806,7 +804,6 @@ impl Context {
|
|||
}
|
||||
|
||||
if max_passes <= output.platform_output.num_completed_passes {
|
||||
#[cfg(feature = "log")]
|
||||
log::debug!(
|
||||
"Ignoring call request_discard, because max_passes={max_passes}. Requested from {:?}",
|
||||
output.platform_output.request_discard_reasons
|
||||
|
|
@ -1819,7 +1816,6 @@ impl Context {
|
|||
let cause = RepaintCause::new_reason(reason);
|
||||
self.output_mut(|o| o.request_discard_reasons.push(cause));
|
||||
|
||||
#[cfg(feature = "log")]
|
||||
log::trace!(
|
||||
"request_discard: {}",
|
||||
if self.will_discard() {
|
||||
|
|
@ -2525,7 +2521,6 @@ impl ContextImpl {
|
|||
let parent = *self.viewport_parents.entry(id).or_default();
|
||||
|
||||
if !all_viewport_ids.contains(&parent) {
|
||||
#[cfg(feature = "log")]
|
||||
log::debug!(
|
||||
"Removing viewport {:?} ({:?}): the parent is gone",
|
||||
id,
|
||||
|
|
@ -2538,7 +2533,6 @@ impl ContextImpl {
|
|||
let is_our_child = parent == ended_viewport_id && id != ViewportId::ROOT;
|
||||
if is_our_child {
|
||||
if !viewport.used {
|
||||
#[cfg(feature = "log")]
|
||||
log::debug!(
|
||||
"Removing viewport {:?} ({:?}): it was never used this pass",
|
||||
id,
|
||||
|
|
@ -2637,7 +2631,6 @@ impl Context {
|
|||
let texture_atlas = if let Some(fonts) = ctx.fonts.as_ref() {
|
||||
fonts.texture_atlas()
|
||||
} else {
|
||||
#[cfg(feature = "log")]
|
||||
log::warn!("No font size matching {pixels_per_point} pixels per point found.");
|
||||
ctx.fonts
|
||||
.iter()
|
||||
|
|
|
|||
|
|
@ -154,7 +154,6 @@ impl PaintList {
|
|||
#[inline(always)]
|
||||
pub fn set(&mut self, idx: ShapeIdx, clip_rect: Rect, shape: Shape) {
|
||||
if self.0.len() <= idx.0 {
|
||||
#[cfg(feature = "log")]
|
||||
log::warn!("Index {} is out of bounds for PaintList", idx.0);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ impl DefaultBytesLoader {
|
|||
.or_insert_with_key(|_uri| {
|
||||
let bytes: Bytes = bytes.into();
|
||||
|
||||
#[cfg(feature = "log")]
|
||||
log::trace!("loaded {} bytes for uri {_uri:?}", bytes.len());
|
||||
|
||||
bytes
|
||||
|
|
@ -53,14 +52,12 @@ impl BytesLoader for DefaultBytesLoader {
|
|||
}
|
||||
|
||||
fn forget(&self, uri: &str) {
|
||||
#[cfg(feature = "log")]
|
||||
log::trace!("forget {uri:?}");
|
||||
|
||||
self.cache.lock().remove(uri);
|
||||
}
|
||||
|
||||
fn forget_all(&self) {
|
||||
#[cfg(feature = "log")]
|
||||
log::trace!("forget all");
|
||||
|
||||
self.cache.lock().clear();
|
||||
|
|
|
|||
|
|
@ -102,14 +102,12 @@ impl TextureLoader for DefaultTextureLoader {
|
|||
}
|
||||
|
||||
fn forget(&self, uri: &str) {
|
||||
#[cfg(feature = "log")]
|
||||
log::trace!("forget {uri:?}");
|
||||
|
||||
self.cache.lock().retain(|key, _value| key.uri != uri);
|
||||
}
|
||||
|
||||
fn forget_all(&self) {
|
||||
#[cfg(feature = "log")]
|
||||
log::trace!("forget all");
|
||||
|
||||
self.cache.lock().clear();
|
||||
|
|
|
|||
|
|
@ -68,7 +68,6 @@ impl OperatingSystem {
|
|||
{
|
||||
Self::Nix
|
||||
} else {
|
||||
#[cfg(feature = "log")]
|
||||
log::warn!(
|
||||
"egui: Failed to guess operating system from User-Agent {:?}. Please file an issue at https://github.com/emilk/egui/issues",
|
||||
user_agent
|
||||
|
|
|
|||
|
|
@ -1248,7 +1248,6 @@ impl Ui {
|
|||
if let Some(tag) = tag {
|
||||
tag.set_close();
|
||||
} else {
|
||||
#[cfg(feature = "log")]
|
||||
log::warn!("Called ui.close() on a Ui that has no closable parent.");
|
||||
}
|
||||
}
|
||||
|
|
@ -1277,7 +1276,6 @@ impl Ui {
|
|||
if let Some(tag) = tag {
|
||||
tag.set_close();
|
||||
} else {
|
||||
#[cfg(feature = "log")]
|
||||
log::warn!("Called ui.close_kind({ui_kind:?}) on ui with no such closable parent.");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -291,7 +291,6 @@ fn from_ron_str<T: serde::de::DeserializeOwned>(ron: &str) -> Option<T> {
|
|||
match ron::from_str::<T>(ron) {
|
||||
Ok(value) => Some(value),
|
||||
Err(_err) => {
|
||||
#[cfg(feature = "log")]
|
||||
log::warn!(
|
||||
"egui: Failed to deserialize {} from memory: {}, ron error: {:?}",
|
||||
std::any::type_name::<T>(),
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ chrono = { version = "0.4", default-features = false, features = [
|
|||
eframe = { workspace = true, default-features = false, features = [
|
||||
"web_screen_reader",
|
||||
] }
|
||||
egui = { workspace = true, features = ["callstack", "default", "log"] }
|
||||
egui = { workspace = true, features = ["callstack", "default"] }
|
||||
egui_demo_lib = { workspace = true, features = ["default", "chrono"] }
|
||||
egui_extras = { workspace = true, features = ["default", "image"] }
|
||||
image = { workspace = true, default-features = false, features = [
|
||||
|
|
@ -70,7 +70,11 @@ puffin = { workspace = true, optional = true }
|
|||
puffin_http = { workspace = true, optional = true }
|
||||
# Enable both WebGL & WebGPU when targeting the web (these features have no effect when not targeting wasm32)
|
||||
# Also enable the default features so we have a supported backend for every platform.
|
||||
wgpu = { workspace = true, features = ["default", "webgpu", "webgl"], optional = true }
|
||||
wgpu = { workspace = true, features = [
|
||||
"default",
|
||||
"webgpu",
|
||||
"webgl",
|
||||
], optional = true }
|
||||
|
||||
|
||||
# feature "http":
|
||||
|
|
|
|||
|
|
@ -44,9 +44,6 @@ color-hex = ["ecolor/color-hex"]
|
|||
## If you plan on specifying your own fonts you may disable this feature.
|
||||
default_fonts = ["epaint_default_fonts"]
|
||||
|
||||
## 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"]
|
||||
|
||||
|
|
@ -71,6 +68,7 @@ ecolor.workspace = true
|
|||
|
||||
ab_glyph = "0.2.11"
|
||||
ahash.workspace = true
|
||||
log.workspace = true
|
||||
nohash-hasher.workspace = true
|
||||
parking_lot.workspace = true # Using parking_lot over std::sync::Mutex gives 50% speedups in some real-world scenarios.
|
||||
profiling = { workspace = true}
|
||||
|
|
@ -81,7 +79,6 @@ bytemuck = { workspace = true, optional = true, features = ["derive"] }
|
|||
## Enable this when generating docs.
|
||||
document-features = { workspace = true, optional = true }
|
||||
|
||||
log = { workspace = true, optional = true }
|
||||
rayon = { version = "1.7", optional = true }
|
||||
|
||||
## Allow serialization using [`serde`](https://docs.rs/serde) .
|
||||
|
|
|
|||
|
|
@ -2000,12 +2000,10 @@ impl Tessellator {
|
|||
}
|
||||
|
||||
if galley.pixels_per_point != self.pixels_per_point {
|
||||
let warn = "epaint: WARNING: pixels_per_point (dpi scale) have changed between text layout and tessellation. \
|
||||
You must recreate your text shapes if pixels_per_point changes.";
|
||||
#[cfg(feature = "log")]
|
||||
log::warn!("{warn}");
|
||||
#[cfg(not(feature = "log"))]
|
||||
println!("{warn}");
|
||||
log::warn!(
|
||||
"epaint: WARNING: pixels_per_point (dpi scale) have changed between text layout and tessellation. \
|
||||
You must recreate your text shapes if pixels_per_point changes."
|
||||
);
|
||||
}
|
||||
|
||||
out.vertices.reserve(galley.num_vertices);
|
||||
|
|
|
|||
|
|
@ -463,7 +463,6 @@ impl CachedFamily {
|
|||
.glyph_info_no_cache_or_fallback(PRIMARY_REPLACEMENT_CHAR, fonts_by_id)
|
||||
.or_else(|| slf.glyph_info_no_cache_or_fallback(FALLBACK_REPLACEMENT_CHAR, fonts_by_id))
|
||||
.unwrap_or_else(|| {
|
||||
#[cfg(feature = "log")]
|
||||
log::warn!(
|
||||
"Failed to find replacement characters {PRIMARY_REPLACEMENT_CHAR:?} or {FALLBACK_REPLACEMENT_CHAR:?}. Will use empty glyph."
|
||||
);
|
||||
|
|
|
|||
|
|
@ -238,7 +238,6 @@ impl TextureAtlas {
|
|||
if required_height > self.max_height() {
|
||||
// This is a bad place to be - we need to start reusing space :/
|
||||
|
||||
#[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
|
||||
|
|
|
|||
Loading…
Reference in New Issue