The new string interpolation syntax in C# 6 has a drawback when used with NLog: It performs the interpolation regardless of which log levels are enabled (since it has to be passed as a string to NLog; I haven't found any evidence to the contrary at least). It should be possible to avoid this if we can pass the interpolated string as IFormattable or FormattableString.
https://msdn.microsoft.com/en-us/library/dn961160.aspx describes how interpolated strings can be implicitly cast to IFormattable and FormattableString, which gave me the idea.
I haven't had a chance to dive deep into the details about performance, but I found this interesting discussion: dotnet/roslyn#518
I leave it to you to judge if it's a good idea, but I couldn't find any mention of IFormattable or FormattableString here, and felt there should at least be an issue discussing it :)
The new string interpolation syntax in C# 6 has a drawback when used with NLog: It performs the interpolation regardless of which log levels are enabled (since it has to be passed as a string to NLog; I haven't found any evidence to the contrary at least). It should be possible to avoid this if we can pass the interpolated string as IFormattable or FormattableString.
https://msdn.microsoft.com/en-us/library/dn961160.aspx describes how interpolated strings can be implicitly cast to IFormattable and FormattableString, which gave me the idea.
I haven't had a chance to dive deep into the details about performance, but I found this interesting discussion: dotnet/roslyn#518
I leave it to you to judge if it's a good idea, but I couldn't find any mention of IFormattable or FormattableString here, and felt there should at least be an issue discussing it :)