-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
Interpolated string handler method names
- Specification: https://github.com/dotnet/csharplang/blob/main/proposals/interpolated-string-handler-argument-value.md
- Discussion: Interpolated string handler method names #9047
Summary
In order to solve a pain point in the creation of handler types and make them more useful in logging scenarios, we add support for interpolated string handlers to receive a new piece of information, a custom value supplied at the call site.
public void LogDebug(
this ILogger logger,
[InterpolatedStringHandlerArgument(nameof(logger))]
[InterpolatedStringHandlerArgumentValue(LogLevel.Debug)]
LogInterpolatedStringHandler message);
Design meetings
- https://github.com/dotnet/csharplang/blob/main/meetings/2025/LDM-2025-01-15.md#interpolated-string-handler-method-names
- https://github.com/dotnet/csharplang/blob/main/meetings/2025/LDM-2025-02-24.md#interpolated-string-handler-method-names
- https://github.com/dotnet/csharplang/blob/main/meetings/2025/LDM-2025-04-07.md#interpolated-string-handler-argument-values