I got a bit of the time to look deeper at it and seems to be a mechanism similar to structured logging, which is already used for JSON logging engine. See:
- https://github.com/kamailio/kamailio/blob/master/src/core/dprint.h#L338-L353
I added a function to be able to set custom slog callback from anywhere with the commit c5c84099fc29623c4f0b8faf9e6151eeaf4421c1 . Before was only done from core based on cli parameter.
With the slog function you get the attributes in a single structure parameter, while this PR adds a similar approach, but with attributes given as function parameters. If I haven't missed something from this PR, you have now all it is needed without merging this PR.