Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Adding Debug implementations for App, Stage, Schedule, Query, QueryState, etc. #6214

Closed
wants to merge 11 commits into from

Conversation

targrub
Copy link
Contributor

@targrub targrub commented Oct 9, 2022

Objective

Solution

  • Implemented std::fmt::Debug for a number of structures.

Changelog

Also added Debug implementations for ParallelSystemExecutor, SingleThreadedExecutor, various RunCriteria structures, SystemContainer, and SystemDescriptor.

Opinions are sure to differ as to what information to provide in a Debug implementation. Best guess was taken for this initial version for these structures.

@alice-i-cecile alice-i-cecile added A-ECS Entities, components, systems, and events C-Usability A simple quality-of-life change that makes Bevy easier to use labels Oct 9, 2022
Added a copy of the Debug of App for SubApps. 
 Removed newline in SystemContainer Debug.  Added more Debug info for Systems with run criteria.
@targrub
Copy link
Contributor Author

targrub commented Oct 10, 2022

There is something odd about the output for Schedule.stages, and it probably is due to this downcasting in impl Debug for dyn Stage: self.as_any().downcast_ref::<SystemStage>(). Part of the output will be something like this:

 CoreStage::Last: Stage Some(SystemStage: { 

Note the "Some(". Ideas?

@harudagondi
Copy link
Member

Note the "Some(". Ideas?

downcast_ref returns Option<&T>. I'm not familiar with Stage and SystemStage, but if Stage is only impl for SystemStage and nothing else, then I think it's safe to unwrap it.

crates/bevy_ecs/src/schedule/stage.rs Outdated Show resolved Hide resolved
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy with this now. Great work.

bors r+

@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Oct 10, 2022
bors bot pushed a commit that referenced this pull request Oct 10, 2022
…ate, etc. (#6214)

# Objective

- Adding Debug implementations for App, Stage, Schedule, Query, QueryState.
- Fixes #1130.

## Solution

- Implemented std::fmt::Debug for a number of structures.

---

## Changelog

Also added Debug implementations for ParallelSystemExecutor, SingleThreadedExecutor, various RunCriteria structures, SystemContainer, and SystemDescriptor.

Opinions are sure to differ as to what information to provide in a Debug implementation.  Best guess was taken for this initial version for these structures.


Co-authored-by: targrub <62773321+targrub@users.noreply.github.com>
@bors
Copy link
Contributor

bors bot commented Oct 10, 2022

Build failed:

@alice-i-cecile
Copy link
Member

bors retry

bors bot pushed a commit that referenced this pull request Oct 10, 2022
…ate, etc. (#6214)

# Objective

- Adding Debug implementations for App, Stage, Schedule, Query, QueryState.
- Fixes #1130.

## Solution

- Implemented std::fmt::Debug for a number of structures.

---

## Changelog

Also added Debug implementations for ParallelSystemExecutor, SingleThreadedExecutor, various RunCriteria structures, SystemContainer, and SystemDescriptor.

Opinions are sure to differ as to what information to provide in a Debug implementation.  Best guess was taken for this initial version for these structures.


Co-authored-by: targrub <62773321+targrub@users.noreply.github.com>
@bors bors bot changed the title Adding Debug implementations for App, Stage, Schedule, Query, QueryState, etc. [Merged by Bors] - Adding Debug implementations for App, Stage, Schedule, Query, QueryState, etc. Oct 10, 2022
@bors bors bot closed this Oct 10, 2022
@targrub targrub deleted the Issue1130 branch October 10, 2022 21:22
@mockersf mockersf added the hacktoberfest-accepted A PR that was accepted for Hacktoberfest, an annual open source event label Oct 10, 2022
james7132 pushed a commit to james7132/bevy that referenced this pull request Oct 19, 2022
…ate, etc. (bevyengine#6214)

# Objective

- Adding Debug implementations for App, Stage, Schedule, Query, QueryState.
- Fixes bevyengine#1130.

## Solution

- Implemented std::fmt::Debug for a number of structures.

---

## Changelog

Also added Debug implementations for ParallelSystemExecutor, SingleThreadedExecutor, various RunCriteria structures, SystemContainer, and SystemDescriptor.

Opinions are sure to differ as to what information to provide in a Debug implementation.  Best guess was taken for this initial version for these structures.


Co-authored-by: targrub <62773321+targrub@users.noreply.github.com>
james7132 pushed a commit to james7132/bevy that referenced this pull request Oct 28, 2022
…ate, etc. (bevyengine#6214)

# Objective

- Adding Debug implementations for App, Stage, Schedule, Query, QueryState.
- Fixes bevyengine#1130.

## Solution

- Implemented std::fmt::Debug for a number of structures.

---

## Changelog

Also added Debug implementations for ParallelSystemExecutor, SingleThreadedExecutor, various RunCriteria structures, SystemContainer, and SystemDescriptor.

Opinions are sure to differ as to what information to provide in a Debug implementation.  Best guess was taken for this initial version for these structures.


Co-authored-by: targrub <62773321+targrub@users.noreply.github.com>
Pietrek14 pushed a commit to Pietrek14/bevy that referenced this pull request Dec 17, 2022
…ate, etc. (bevyengine#6214)

# Objective

- Adding Debug implementations for App, Stage, Schedule, Query, QueryState.
- Fixes bevyengine#1130.

## Solution

- Implemented std::fmt::Debug for a number of structures.

---

## Changelog

Also added Debug implementations for ParallelSystemExecutor, SingleThreadedExecutor, various RunCriteria structures, SystemContainer, and SystemDescriptor.

Opinions are sure to differ as to what information to provide in a Debug implementation.  Best guess was taken for this initial version for these structures.


Co-authored-by: targrub <62773321+targrub@users.noreply.github.com>
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
…ate, etc. (bevyengine#6214)

# Objective

- Adding Debug implementations for App, Stage, Schedule, Query, QueryState.
- Fixes bevyengine#1130.

## Solution

- Implemented std::fmt::Debug for a number of structures.

---

## Changelog

Also added Debug implementations for ParallelSystemExecutor, SingleThreadedExecutor, various RunCriteria structures, SystemContainer, and SystemDescriptor.

Opinions are sure to differ as to what information to provide in a Debug implementation.  Best guess was taken for this initial version for these structures.


Co-authored-by: targrub <62773321+targrub@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Usability A simple quality-of-life change that makes Bevy easier to use hacktoberfest-accepted A PR that was accepted for Hacktoberfest, an annual open source event S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Better Debug support for Bevy ECS
4 participants