On 03/28/2012 11:37 AM, Gergely Nagy wrote:
Dmitri Pal dpal@redhat.com writes:
- template based (ELAPI or similar)
a template that lists the names, followed by the types and values
- memory structure based
a tree structure is created pointing to the names and values. a pointer to this structure is passed to the logging call.
This last one could be a variation or replacement for ul_syslog(), and I think it would be ideal if we could hash things out so that it can be just a newer variation of ul_syslog()
I think that all of these variations are appropriate to have (with the possible combination of #2 and #4)
David Lang
I see 3 & 4 as being the same thing as you can't do templates without memory structure.
The difference is in the API, not in the underlying structures in which you store the result.
Template-based would be something like: foo_log ("%(message) %(whatever)", msg, whatever);
While the same thing with 4 would look somewhat like: foo_log ("message", STRING, msg, "whatever", STRING, whatever, NULL);
The structure you end up with might very well be the same underneath, but the API is much different.
IMO they should be a part of the same interface
foo_log ("message", STRING, msg, "whatever", STRING, whatever, "readable_message" STRING "%(message) %(whatever)" NULL);
Or
foo_log ("readable_message" STRING "%(message) %(whatever)" "message", STRING, msg, "whatever", STRING, whatever, NULL);
Should be possible and produce the same result