-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Implement pretty component logging #21587
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this, but I'd prefer to only have one method for this. I'm fine to either make this the only method, or to require users to provide an argument to log_components
.
I did not know that the alt debugger was different from pretty printing! Tried it out and it's lovely. Changed it to Chris' suggestion :)
|
.inspect_entity(entity.id()) | ||
.expect("Entity existence is verified before an EntityCommand is executed") | ||
.map(ComponentInfo::name) | ||
.map(|info| info.name().to_string()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just leaving a note here that this isn't as_string because as_string only exists on debug
whereas to_string
handles the debug/no-debug difference
I don’t want to block this, but something to consider is being able to put these in a span as my default logging settings tend to block info level logs from sources other then my game. If I could put an optional span name it would be easier to just allow a specific span name. Even if you don’t use span for filtering it could be another way of pinning down the specific log? |
I think it is best to defer to another request, as discussed in discord |
Head branch was pushed to by a user without write access
Objective
log_components
looks like this:eek! what is going on??? I could pretty-print this by fiddling with the logging filters, but that
Can I just pretty print the component log plz?
Solution
Add
log_components_pretty
:much better!
DebugName
wrapperAnd we can go one step further when downstream (thanks Chris!)
which gives us newlines:
Additional info
Added a
debug
feature because the experience of getting blasted with 30 strings telling me to enable a feature is suboptimal.