itamarst / eliot

Eliot: the logging system that tells you *why* it happened
https://eliot.readthedocs.io
Apache License 2.0
1.1k stars 66 forks source link

Point to the call site where a log mesage that fails validation was emitted #365

Closed exarkun closed 5 years ago

exarkun commented 5 years ago

The traceback associated with a validation failure is pretty much useless. It points to test runner innards and Eliot innards. It doesn't point to the call site where the log message was emitted. It doesn't even say what the action or message type was. It only reports the field that failed validation.

Debugging validation failures would be easier with an action or message type. It would be much easier with a filename and line number.

I imagine there are many good reasons not to collect this information during normal operation but I think it may be feasible to collect when running with the intent of validating.

itamarst commented 5 years ago

See #324 for sketch of relevant implementation.

itamarst commented 5 years ago

Another alternative to adding the location to the message is doing basic validation immediately when the message is logged... are you using the type system, or is this some other form of validation failure?

exarkun commented 5 years ago

I am using the type system, yea.