System piping for error/warn/info logging does not show error source #8638
Labels
A-Diagnostics
Logging, crash handling, error reporting and performance analysis
A-ECS
Entities, components, systems, and events
C-Usability
A simple quality-of-life change that makes Bevy easier to use
Bevy version
What you did
Attach
warn
to a system that would return a result:What went wrong
I expected to get information about where the error was generated from, i.e.
Instead, I only get the module location of
warn
:Additional information
Discussed in #8637
Originally posted by fallible-algebra May 19, 2023
I've been working on a bevy project for a couple of months and have come across a minor information hiccup with error logging.
When using system piping for error logging, the results the system return will get reported by the logging suite as coming from the wrapper system (i.e.
warn
orinfo
) rather than the function that returned the error i.e. as a stripped down version of this exampleThe latter is desired as it gives me information as to where the warning is actually coming from, and my project has a wide and deep directory tree.
I'm aware this is behaviour to be expected from using the logging suite + the system piping interfaces together, but this is suboptimal from a point of view of using system piping for error logging. Is there a macro-based approach someone else has worked on? Something that transforms a system that returns a result into a system that doesn't return a result that matches on the result in-function-body, i.e.
Or is there something else I should be relying on, have I missed something obvious, or is this all splitting hairs? Thanks.
I want to be clear that I don't presume that
warn
(the adaptor) can be capable of getting this information, that it is correct to pursue a solution where warn can receive that information, or that the macro solution is necessarily correct either.I am aware this is a limitation on using system piping as error logging, but it was the direction I was pointed in for being able to handle errors in systems via results and ?s instead of unwraps and expects and logging in-systems and I'm losing logging information on a project with a broad and deep structure via this method.
Thanks for continuing to develop bevy.
The text was updated successfully, but these errors were encountered: