bevy icon indicating copy to clipboard operation
bevy copied to clipboard

multiple apps cause unexpected plugin warnings

Open robtfm opened this issue 2 years ago • 0 comments

Bevy version

0.10

What you did

create two apps and add some plugins to both:

use bevy::{
    prelude::*,
    app::{PluginGroupBuilder, ScheduleRunnerPlugin},
    diagnostic::DiagnosticsPlugin,
    log::LogPlugin,
    render::mesh::MeshPlugin,
    time::TimePlugin,
};

pub struct TestPlugins;

impl PluginGroup for TestPlugins {
    fn build(self) -> PluginGroupBuilder {
        PluginGroupBuilder::start::<Self>()
            .add(LogPlugin::default())
            .add(TaskPoolPlugin::default())
            .add(TypeRegistrationPlugin::default())
            .add(FrameCountPlugin::default())
            .add(TimePlugin::default())
            .add(ScheduleRunnerPlugin::default())
            .add(TaskPoolPlugin::default())
            .add(TypeRegistrationPlugin::default())
            .add(FrameCountPlugin::default())
            .add(TimePlugin::default())
            .add(TransformPlugin::default())
            .add(HierarchyPlugin::default())
            .add(DiagnosticsPlugin::default())
            .add(AssetPlugin::default())
            .add(MeshPlugin)
    }
}

fn main() {
    let mut app1 = App::new();
    app1.add_plugins(TestPlugins);

    let mut app2 = App::new();
    app2.add_plugins(TestPlugins);
}

What went wrong

some warnings are emitted about re-adding plugins:

2023-03-14T16:01:25.250769Z  WARN bevy_app::plugin_group: You are replacing plugin 'bevy_core::TaskPoolPlugin' that was not disabled.
2023-03-14T16:01:25.250969Z  WARN bevy_app::plugin_group: You are replacing plugin 'bevy_core::TypeRegistrationPlugin' that was not disabled.
2023-03-14T16:01:25.251140Z  WARN bevy_app::plugin_group: You are replacing plugin 'bevy_core::FrameCountPlugin' that was not disabled.
2023-03-14T16:01:25.251254Z  WARN bevy_app::plugin_group: You are replacing plugin 'bevy_time::TimePlugin' that was not disabled.
2023-03-14T16:01:25.251703Z  WARN bevy_log: Could not set global logger and tracing subscriber as they are already set. Consider disabling LogPlugin.

the log plugin warning seems legitimate but the others are confusingly worded at best, and make me worry that there is some shared state between the apps.

robtfm avatar Mar 14 '23 16:03 robtfm