msbuild icon indicating copy to clipboard operation
msbuild copied to clipboard

Log helper methods should support a custom string interpolation handler

Open rainersigwald opened this issue 2 years ago • 2 comments

C# 10 supports string interpolation handlers that enable efficient behavior with calls like (from their examples):

logger.LogMessage(LogLevel.Trace, $"Trace Level. CurrentTime: {time:t}. This won't be printed.");

This would be really nice to have in Log.LogMessage and related APIs.

rainersigwald avatar Aug 11 '22 01:08 rainersigwald

I'm unclear on what the goal is here. Many of our logging helper methods call into our localized resources, so we couldn't do anything as clean as the example you shared. What are you thinking?

Forgind avatar Aug 18 '22 19:08 Forgind

It's not about our logging; it's about the logging API we provide to tasks.

rainersigwald avatar Aug 25 '22 13:08 rainersigwald