JSON log output
Hey, I love your program and have been trying to integrate it into a project of mine. At first I tried to use the library, but since my project doesn't use c++ I had to make bindings which was really annoying. Which is why I think it would be great to add JSONL console output to the dwarfs commands (atleast dwarfsextract) since it would allow using the binaries as a sort of high-level api to dwarfs. It would also simplify usage in shell scripts.
I'm assuming that the project doesn't already use structured logging, so adding that is probably very difficult. But something that is easier to parse would be great.
I'll be honest: I'd much rather spend my time working on a (stable) C API than adding JSON logging. I don't really see that much point in the latter and it'll make it much harder to change the logging if you have to consider that someone might rely on the "old" format.
I fact, I've already started working on a C API a while back, I just need to find some time to get back to it.
That being said, all console logging eventually ends up in this method. If all you want is for each log statement to appear as something like
{
"timestamp": "2025-04-01T13:02:31.837659",
"severity": "info",
"filename": "scanner.cpp",
"line": 931,
"message": "yadayada"
}
that would be trivial to implement. But there wouldn't be any guarantees that the "message" (or even the "severity") would stay the same between releases.