You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have two loggers, let's say they're named rpc and eval.
I want to handoff processing from the rpc to eval module, but my rpc logger has request info in its context, which I want to include when I make logging calls from the eval logger.
#238 is one solution, I could copy my rpc logger and also name it eval. Alternatively, if there was a way to extract the context from a logger I could either pass that around detached from the original logger, or write a function which adopted the context from a passed-in logger.
The text was updated successfully, but these errors were encountered:
Another way to achieve this might be to have an implicit context object, which each log call accepts, and includes that context with the log statement. That way you pass around the context, and pair it with your module / class-level logger.
That would save you from having to build a fresh logger each time execution changes hands between modules. But maybe the ergonomics get awkward, as there's now 2 (or 3?) ways to inject context.
I have two loggers, let's say they're named
rpc
andeval
.I want to handoff processing from the
rpc
toeval
module, but myrpc
logger has request info in its context, which I want to include when I make logging calls from theeval
logger.#238 is one solution, I could copy my
rpc
logger and also name iteval
. Alternatively, if there was a way to extract the context from a logger I could either pass that around detached from the original logger, or write a function which adopted the context from a passed-in logger.The text was updated successfully, but these errors were encountered: