Feature Request: Enhance Godot Log Asset
I'd like to request the addition of several features to the log to make it more helpful for testing.
- RAM Usage: The ability to track and log RAM usage throughout the application's runtime.
- Time Between Logs: The option to include timestamps in miliseconds format between each log entry for better timekeeping and understand how long did it take to execute a specific func or a given operation.
- CPU Usage: The ability to log CPU usage alongside other log data.
- VRAM Usage: The ability to track and log VRAM usage throughout the application's runtime. Ability to add to the log file, making it easier to find performance issues and optimize the application on other devices
I like your ideas. I have a few general thoughts though.
- I think that it would turn more into a diagnostics suite more than a logging library.
- I'm unsure what Log could do that the Godot profiler doesn't already do. It seems like a very big endeavor to create something that is of that magnitude.
- I understand your wish to know what your users experience in the form of performance, however a core issue of any profiling suite is that it takes precious processing time away from the frame. For reference, currently each and every log message takes approximately 200us on my laptop, which is rather awful when you consider that you have something like 16ms per frame at 60fps. This means that a log message is currently taking approximately 1.25% of the total frame budget, which is just unacceptably expensive in a production environment. So adding more things to the logging data is just no feasible at the moment.
So in conclusion. This will not happen until I've converted this add-on to GDExtension (which will of course have the exact same method signatures so nothing breaks for the user). I may be able to add something like a rolling average of resource usage with distributions and so on. Maybe. Could you describe the use case so I understand how Log could maybe help you in the future?
I was considering alternatives to procdump, specifically for those situations where the game becomes unresponsive or the player encounters unexpected issues. These enhanced logs could be invaluable in diagnosing and resolving such problems, leading to a smoother experience for players overall.