Open manishtomar opened 9 years ago
I would like an API that uses a positional argument as the otter_msg_type, for example:
log.event("the-msg-type", **kwargs)
perhaps for errors we could do something like...
log.err_event(Failure_or_None, "the-msg-type")
@radix Yes. That is what I had in mind :)
I am having second thoughts about validating message field types. Since I will be partially doing what a JSON schema validator does, why not use that directly? i.e. describe each log type's fields as a JSON schema and validate it using a schema validator. This does seem like a lot of work for every log message.
@radix Any thoughts?
@manishtomar I think json-schema is a decent way to specify our schemas, and is preferable to rolling our own schema system.
Here are my thoughts about our logging situation in general, and it mostly comes down to a priority list:
log.msg('event-key')
and log.err(x, 'event-key')
which gets converted to otter_msg_type
in the outputotter_msg_type
Each of these items should be (at least) a separate PR.
Each log should have a message type that has corresponding structure associated with it. The structure includes the textual message, related fields along with their type in it. This structure can be used to induce ES mapping. The code logging will give message type and extra fields. The formatter will validate the fields based on type and log with textual message.