tito
tito copied to clipboard
Structured Log Output
Wishlist: It would be nice to have log output in structures that could be parsed.
I was looking at structlog, we could have nice output like this for normal console use: https://structlog.readthedocs.io/en/stable/development.html. And then -o json to get json output for use in any kind of automation. However structlog 1.16 is required for that nice output, and 1.15 is all that's in Fedora right now. Even worse, EPEL6 and EPEL7 have ancient versions. (containers have ruined me for having choice)
This would require us to start logging structured data rather than plain strings, it will also require breaking anyone who is already manually parsing output. However, parsing output like that would be a bad idea in general and we've never committed to treating the output as any kind of API, it's likely fairly uncommon, so probably ok to proceed.
This would require us to start logging structured data rather than plain strings, it will also require breaking anyone who is already manually parsing output. However, parsing output like that would be a bad idea in general and we've never committed to treating the output as any kind of API, it's likely fairly uncommon, so probably ok to proceed.
I agree with this. If someone is parsing output they can pin to an older version of tito until they are ready to use structured output.
Only downsides are going to be internal parsing -- when I was adding tito build --quiet I noticed there are some places where we parse rpmbuild output, etc, so this will not be a clean cut-over. If we're going structured, I like structlog but we could also use the journald client library.