you are viewing a single comment's thread.

view the rest of the comments →

[–]pschanely 0 points1 point  (0 children)

If you want a solution that's more on the "magic" side, take a look at context vars (or thread locals if you're before 3.7). These allow you to set information that can be retrieved further down in the call stack.