diff options
author | 2023-02-23 09:31:48 -0800 | |
---|---|---|
committer | 2023-02-23 09:31:48 -0800 | |
commit | 07a7681dba5a9a40627689246d2a84414dfc48d3 (patch) | |
tree | 116e1e51d5d66e0a02cc474fbbdae4205f03090d | |
parent | 666f3cd143047e49a010f0c97eabc7136f92aa35 (diff) | |
download | iced-07a7681dba5a9a40627689246d2a84414dfc48d3.tar.gz iced-07a7681dba5a9a40627689246d2a84414dfc48d3.tar.bz2 iced-07a7681dba5a9a40627689246d2a84414dfc48d3.zip |
Remove logging large bytes arrays
-rw-r--r-- | glow/src/settings.rs | 2 | ||||
-rw-r--r-- | glutin/src/application.rs | 2 | ||||
-rw-r--r-- | src/window/icon.rs | 8 | ||||
-rw-r--r-- | wgpu/src/settings.rs | 18 | ||||
-rw-r--r-- | winit/src/application.rs | 2 | ||||
-rw-r--r-- | winit/src/settings.rs | 23 |
6 files changed, 49 insertions, 6 deletions
diff --git a/glow/src/settings.rs b/glow/src/settings.rs index 8ccffbad..6aaa0d55 100644 --- a/glow/src/settings.rs +++ b/glow/src/settings.rs @@ -43,7 +43,7 @@ impl std::fmt::Debug for Settings { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.debug_struct("Settings") // Instead of printing the font bytes, we simply show a `bool` indicating if using a default font or not. - .field("default_font", &self.default_font.is_none()) + .field("default_font", &self.default_font.is_some()) .field("default_text_size", &self.default_text_size) .field("text_multithreading", &self.text_multithreading) .field("antialiasing", &self.antialiasing) diff --git a/glutin/src/application.rs b/glutin/src/application.rs index b7bf21c3..5921bdd0 100644 --- a/glutin/src/application.rs +++ b/glutin/src/application.rs @@ -71,7 +71,7 @@ where settings.id, ); - log::info!("Window builder: {:#?}", builder); + log::debug!("Window builder: {:#?}", builder); let opengl_builder = ContextBuilder::new() .with_vsync(true) diff --git a/src/window/icon.rs b/src/window/icon.rs index d57eb79c..659d2b64 100644 --- a/src/window/icon.rs +++ b/src/window/icon.rs @@ -6,9 +6,15 @@ use std::io; use std::path::Path; /// The icon of a window. -#[derive(Debug, Clone)] +#[derive(Clone)] pub struct Icon(iced_winit::winit::window::Icon); +impl fmt::Debug for Icon { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_tuple("Icon").field(&format_args!("_")).finish() + } +} + impl Icon { /// Creates an icon from 32bpp RGBA data. pub fn from_rgba( diff --git a/wgpu/src/settings.rs b/wgpu/src/settings.rs index fd3b990a..5ef79499 100644 --- a/wgpu/src/settings.rs +++ b/wgpu/src/settings.rs @@ -1,10 +1,12 @@ //! Configure a renderer. +use std::fmt; + pub use crate::Antialiasing; /// The settings of a [`Backend`]. /// /// [`Backend`]: crate::Backend -#[derive(Debug, Clone, Copy, PartialEq)] +#[derive(Clone, Copy, PartialEq)] pub struct Settings { /// The present mode of the [`Backend`]. /// @@ -36,6 +38,20 @@ pub struct Settings { pub antialiasing: Option<Antialiasing>, } +impl fmt::Debug for Settings { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("Settings") + .field("present_mode", &self.present_mode) + .field("internal_backend", &self.internal_backend) + // Instead of printing the font bytes, we simply show a `bool` indicating if using a default font or not. + .field("default_font", &self.default_font.is_some()) + .field("default_text_size", &self.default_text_size) + .field("text_multithreading", &self.text_multithreading) + .field("antialiasing", &self.antialiasing) + .finish() + } +} + impl Settings { /// Creates new [`Settings`] using environment configuration. /// diff --git a/winit/src/application.rs b/winit/src/application.rs index 3fdec658..9781a453 100644 --- a/winit/src/application.rs +++ b/winit/src/application.rs @@ -157,7 +157,7 @@ where ) .with_visible(false); - log::info!("Window builder: {:#?}", builder); + log::debug!("Window builder: {:#?}", builder); let window = builder .build(&event_loop) diff --git a/winit/src/settings.rs b/winit/src/settings.rs index 45f38833..78d58000 100644 --- a/winit/src/settings.rs +++ b/winit/src/settings.rs @@ -23,9 +23,12 @@ pub use platform::PlatformSpecific; use crate::conversion; use crate::Position; + use winit::monitor::MonitorHandle; use winit::window::WindowBuilder; +use std::fmt; + /// The settings of an application. #[derive(Debug, Clone, Default)] pub struct Settings<Flags> { @@ -59,7 +62,7 @@ pub struct Settings<Flags> { } /// The window settings of an application. -#[derive(Debug, Clone)] +#[derive(Clone)] pub struct Window { /// The size of the window. pub size: (u32, u32), @@ -95,6 +98,24 @@ pub struct Window { pub platform_specific: platform::PlatformSpecific, } +impl fmt::Debug for Window { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("Window") + .field("size", &self.size) + .field("position", &self.position) + .field("min_size", &self.min_size) + .field("max_size", &self.max_size) + .field("visible", &self.visible) + .field("resizable", &self.resizable) + .field("decorations", &self.decorations) + .field("transparent", &self.transparent) + .field("always_on_top", &self.always_on_top) + .field("icon", &self.icon.is_some()) + .field("platform_specific", &self.platform_specific) + .finish() + } +} + impl Window { /// Converts the window settings into a `WindowBuilder` from `winit`. pub fn into_builder( |