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

Console formatting for duration #709

Open
mitar opened this issue Feb 16, 2025 · 1 comment
Open

Console formatting for duration #709

mitar opened this issue Feb 16, 2025 · 1 comment

Comments

@mitar
Copy link
Contributor

mitar commented Feb 16, 2025

Console output is meant to be human-readable, but durations are shown as floats (e.g., in seconds or milliseconds) which is far from human-readable for non-simple durations. I know that the issue is that console output is interpreting data in JSON, and in JSON the fact that a field was a duration is lost, is just a number, but I still think some solution to this should be provided.

One way would be to use FormatFieldValue but sadly it does not get field name as a parameter, so one cannot hard-code it to (known/used) duration field names to convert float to formatted duration string.

Maybe DurationFields could get a list of duration field names?

Currently, it looks that the only workaround is to use FormatPrepare which can do some preprocessing based on (known/used) field names.

Any other suggestion how to tackle this?

@mitar
Copy link
Contributor Author

mitar commented Feb 22, 2025

It seems there is now also FormatPartValueByName to allow formatting per field name, but this is still tricky as you have to maintain what are names of duration fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant