From ecc2053a1d96398f9d65106e9821e4351edab4e7 Mon Sep 17 00:00:00 2001 From: cxreiff Date: Fri, 11 Oct 2024 16:14:49 -0700 Subject: [PATCH] disable LogPlugin in docs and examples --- README.md | 5 ++++- examples/cube.rs | 6 +++++- examples/multiple.rs | 4 +++- examples/resize.rs | 4 +++- examples/shortcut.rs | 4 +++- src/plugin.rs | 14 +++++++++----- 6 files changed, 27 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 4167056..f659218 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,10 @@ fn main() { App::new() .add_plugins(( // disable WinitPlugin as it panics in environments without a display server - DefaultPlugins.build().disable::(), + // disable LogPlugin as it interferes with terminal output. + DefaultPlugins.build() + .disable::() + .disable::(), // create windowless loop and set its frame rate ScheduleRunnerPlugin::run_loop(Duration::from_secs_f64(1. / 60.)), diff --git a/examples/cube.rs b/examples/cube.rs index 6284c43..fe76a99 100644 --- a/examples/cube.rs +++ b/examples/cube.rs @@ -5,6 +5,7 @@ use bevy::app::AppExit; use bevy::app::ScheduleRunnerPlugin; use bevy::core_pipeline::tonemapping::Tonemapping; use bevy::diagnostic::{DiagnosticsStore, FrameTimeDiagnosticsPlugin}; +use bevy::log::LogPlugin; use bevy::prelude::*; use bevy::utils::error; use bevy::winit::WinitPlugin; @@ -30,7 +31,10 @@ pub struct Flags { fn main() { App::new() .add_plugins(( - DefaultPlugins.build().disable::(), + DefaultPlugins + .build() + .disable::() + .disable::(), ScheduleRunnerPlugin::run_loop(Duration::from_secs_f64(1. / 60.)), FrameTimeDiagnosticsPlugin, RatatuiPlugins::default(), diff --git a/examples/multiple.rs b/examples/multiple.rs index 7a71a22..b8b239b 100644 --- a/examples/multiple.rs +++ b/examples/multiple.rs @@ -5,6 +5,7 @@ use bevy::app::AppExit; use bevy::app::ScheduleRunnerPlugin; use bevy::core_pipeline::tonemapping::Tonemapping; use bevy::diagnostic::{DiagnosticsStore, FrameTimeDiagnosticsPlugin}; +use bevy::log::LogPlugin; use bevy::prelude::*; use bevy::utils::error; use bevy::winit::WinitPlugin; @@ -32,7 +33,8 @@ fn main() { .add_plugins(( DefaultPlugins .set(ImagePlugin::default_nearest()) - .disable::(), + .disable::() + .disable::(), ScheduleRunnerPlugin::run_loop(Duration::from_secs_f64(1. / 60.)), FrameTimeDiagnosticsPlugin, RatatuiPlugins::default(), diff --git a/examples/resize.rs b/examples/resize.rs index c3e5976..53f6bbb 100644 --- a/examples/resize.rs +++ b/examples/resize.rs @@ -3,6 +3,7 @@ use std::time::Duration; use bevy::app::AppExit; use bevy::app::ScheduleRunnerPlugin; use bevy::core_pipeline::tonemapping::Tonemapping; +use bevy::log::LogPlugin; use bevy::prelude::*; use bevy::winit::WinitPlugin; use bevy_ratatui::event::KeyEvent; @@ -18,7 +19,8 @@ fn main() { .add_plugins(( DefaultPlugins .set(ImagePlugin::default_nearest()) - .disable::(), + .disable::() + .disable::(), ScheduleRunnerPlugin::run_loop(Duration::from_secs_f64(1. / 60.)), RatatuiPlugins::default(), RatatuiRenderPlugin::new("main", (256, 256)) diff --git a/examples/shortcut.rs b/examples/shortcut.rs index 19411a8..bbce948 100644 --- a/examples/shortcut.rs +++ b/examples/shortcut.rs @@ -2,6 +2,7 @@ use std::time::Duration; use bevy::app::AppExit; use bevy::core_pipeline::tonemapping::Tonemapping; +use bevy::log::LogPlugin; use bevy::winit::WinitPlugin; use bevy::{app::ScheduleRunnerPlugin, prelude::*}; use bevy_ratatui::event::KeyEvent; @@ -17,7 +18,8 @@ fn main() { .add_plugins(( DefaultPlugins .set(ImagePlugin::default_nearest()) - .disable::(), + .disable::() + .disable::(), ScheduleRunnerPlugin::run_loop(Duration::from_secs_f64(1. / 60.)), RatatuiPlugins::default(), RatatuiRenderPlugin::new("main", (256, 256)) diff --git a/src/plugin.rs b/src/plugin.rs index 52d07e0..40c4f82 100644 --- a/src/plugin.rs +++ b/src/plugin.rs @@ -45,22 +45,26 @@ pub type AutoresizeConversionFn = fn((u32, u32)) -> (u32, u32); /// # use bevy::app::ScheduleRunnerPlugin; /// # use bevy::winit::WinitPlugin; /// # use bevy::prelude::*; +/// # use bevy::log::LogPlugin; /// # use bevy_ratatui::RatatuiPlugins; /// # use bevy_ratatui_render::{RatatuiRenderContext, RatatuiRenderPlugin}; /// # /// fn main() { /// App::new() /// .add_plugins(( -/// // disable WinitPlugin as it panics in environments without a display server -/// DefaultPlugins.build().disable::(), +/// // disable WinitPlugin as it panics in environments without a display server. +/// // disable LogPlugin as it interferes with terminal output. +/// DefaultPlugins.build() +/// .disable::() +/// .disable::(), /// -/// // create windowless loop and set its frame rate +/// // create windowless loop and set its frame rate. /// ScheduleRunnerPlugin::run_loop(Duration::from_secs_f64(1. / 60.)), /// -/// // set up the Ratatui context and forward input events +/// // set up the Ratatui context and forward input events. /// RatatuiPlugins::default(), /// -/// // connect a bevy camera target to a ratatui widget +/// // connect a bevy camera target to a ratatui widget. /// RatatuiRenderPlugin::new("main", (256, 256)).print_full_terminal().autoresize(), /// )) /// .add_systems(Startup, setup_scene);