Interpolated string handler method names #9047
Replies: 2 comments 4 replies
-
I'm thinking about the way that this might evolve if the method and handler are split across different assemblies, and wondering if it would be better to annotate the handler as "I need the name of the method being invoked", rather than the calling method being annotated as "please pass the my name into the handler" e.g. something like: public ref struct LogInterpolatedStringHandler
{
public LogInterpolatedStringHandler(..., [CallingMemberName] string methodName, ...) { ... }
} |
Beta Was this translation helpful? Give feedback.
-
While I agree with the premise of the proposal, and want a solution, I, personally, loathe the idea of a magic string. It's already confusing enough that |
Beta Was this translation helpful? Give feedback.
-
Interpolated string handler method names
Champion issue: #9046
Summary
We add support for interpolated string handlers to receive a new piece of information, the name of the method they are an argument
to, in order to solve a pain point in the creation of handler types and make them more useful in logging scenarios.
Beta Was this translation helpful? Give feedback.
All reactions