diff --git a/src/Server_TEST.cc b/src/Server_TEST.cc index b07157b094..a7c327f0db 100644 --- a/src/Server_TEST.cc +++ b/src/Server_TEST.cc @@ -442,8 +442,7 @@ TEST_P(ServerFixture, GZ_UTILS_TEST_DISABLED_ON_WIN32(ServerConfigLogRecord)) EXPECT_EQ(0u, *server.IterationCount()); EXPECT_EQ(3u, *server.EntityCount()); - // Only the log record system is needed and therefore loaded. - EXPECT_EQ(1u, *server.SystemCount()); + EXPECT_EQ(4u, *server.SystemCount()); EXPECT_TRUE(serverConfig.LogRecordTopics().empty()); serverConfig.AddLogRecordTopic("test_topic1"); @@ -482,9 +481,7 @@ TEST_P(ServerFixture, sim::Server server(serverConfig); EXPECT_EQ(0u, *server.IterationCount()); EXPECT_EQ(3u, *server.EntityCount()); - - // Only the log record system is needed and therefore loaded. - EXPECT_EQ(1u, *server.SystemCount()); + EXPECT_EQ(4u, *server.SystemCount()); } EXPECT_FALSE(common::exists(logFile)); diff --git a/src/SimulationRunner.cc b/src/SimulationRunner.cc index 5ce443ff19..21cf1ca3f7 100644 --- a/src/SimulationRunner.cc +++ b/src/SimulationRunner.cc @@ -1587,8 +1587,6 @@ void SimulationRunner::CreateEntities(const sdf::World &_world) this->entityCompMgr.ProcessRemoveEntityRequests(); this->entityCompMgr.ClearRemovedComponents(); - this->LoadLoggingPlugins(this->serverConfig); - // Load any additional plugins from the Server Configuration this->LoadServerPlugins(this->serverConfig.Plugins()); @@ -1601,7 +1599,10 @@ void SimulationRunner::CreateEntities(const sdf::World &_world) auto plugins = gz::sim::loadPluginInfo(isPlayback); this->LoadServerPlugins(plugins); } - + // Load logging plugins after all server plugins so that necessary + // plugins such as SceneBroadcaster are loaded first. This might be + // a bug or an assumption made in the logging plugins. + this->LoadLoggingPlugins(this->serverConfig); // Store the initial state of the ECM; this->initialEntityCompMgr.CopyFrom(this->entityCompMgr);