itamarst / eliot

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

Feature Request: Tracing without modifying the code #465

Open guettli opened 3 years ago

guettli commented 3 years ago

It would be really great, if you could use eliot without modifying the source code.

I would like to provide a list of methods which should create events:

['mymodule.foo.bar', '....]

And call my code via a wrapper:

eliot myscript.py

itamarst commented 3 years ago

This in theory would be possible, especially if one says "and you only support arguments that are encodable to JSON" I suppose, but that's hard to guarantee as code changes. Additionally, there's the risk of breaking code if the wrapper changes semantics.

It also won't trace well with anything async, threaded, or multiprocess without a bunch of extra work.

On the other hand I can think of situations where this might be useful, maybe.

What is your use case for doing this?