Keeping track of separate flows in python async code
I have some python async code that emits log lines to document its progress. However, multiple instances of the same code might be running at the same time, so log lines are also intermixed. I would like to assign a unique identifier (a UUID, whatever) to each running task/instance that I can prepend to its log lines, so that logs can later be postprocessed to separate the various logs.
The code also calls functions in other modules, so the usual idiom for module logging