You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Various engineering teams use ILogger<T> instead of ILogger with source generation. However, the CreateReplaySafeLogger<T> method returns an ILogger, creating an incompatibility with these practices.
Suggested fix
Change CreateReplaySafeLogger<T> to return ILogger<T>.
This is not a source-breaking change, but it is a binary-breaking change. We should make a decision about whether this meets the bar for a breaking-change release, or whether we should include this as a minor version release (with appropriate documentation) that can be released sooner.
For now I recommend we change the implementation to return ILogger<T> (not signature though, callers will need to cast). Consumers will need to cast for the time being. We can continue to track this issue and change the return type in the next major version rev.
Also want to point out that if a caller needs ILogger<T>, they can always wrap the ILogger returned by CreateReplaySafeLogger<T> in their own shim. There is no special additional logic needed for ILogger<T> . The default implementation of ILogger<T> is just that - a wrapper around ILogger.
Issue
Various engineering teams use
ILogger<T>
instead ofILogger
with source generation. However, theCreateReplaySafeLogger<T>
method returns anILogger
, creating an incompatibility with these practices.Suggested fix
Change
CreateReplaySafeLogger<T>
to returnILogger<T>
.This is not a source-breaking change, but it is a binary-breaking change. We should make a decision about whether this meets the bar for a breaking-change release, or whether we should include this as a minor version release (with appropriate documentation) that can be released sooner.
/cc @jviau
The text was updated successfully, but these errors were encountered: