tito icon indicating copy to clipboard operation
tito copied to clipboard

Structured Log Output

Open ashcrow opened this issue 8 years ago • 3 comments

Wishlist: It would be nice to have log output in structures that could be parsed.

ashcrow avatar Jun 12 '17 23:06 ashcrow

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.

dgoodwin avatar Jun 13 '17 11:06 dgoodwin

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.

ashcrow avatar Jun 13 '17 13:06 ashcrow

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.

stevekuznetsov avatar Jun 13 '17 14:06 stevekuznetsov