Closed biqas closed 5 months ago
Interesting proposal. However, I'm concerned that this might end up being a less recommended approach due to the significantly different behavior during String Interpolation.
I don't think this will be an issue. dotnet team is also making use of it to rewrite/replace/intercept the routing map methods to make them aot friendly.
ILogger.Log($"Hello, {name}")
and ILogger.ZLog($"Hello, {name}")
have the same interface, but different behavior.
The former just generates a string.
The latter recognizes variables like name
and uses them for structured logging.
I don't think Routing.Map just applies optimizations and doesn't differ in this kind of behavior.
Wouldn't it be confusing to treat this transparently?
Hi,
can you not make use of interceptors from C# 12? Then the method signature would stay same and no changes would be required to use ZLogger or not? Also, you would stay compatible with Microsoft ILogger interface.