-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Description
We have a couple cases caught by the new LoggerMessage analyzer in dotnet/runtime#64667.
Two duplicates here: InvokeDotNetMethodException and InvokeDotNetMethodSuccess
aspnetcore/src/Components/Server/src/Circuits/RemoteJSRuntime.cs
Lines 199 to 209 in 334da01
| [LoggerMessage(2, LogLevel.Debug, "There was an error invoking the static method '[{AssemblyName}]::{MethodIdentifier}' with callback id '{CallbackId}'.", EventName = "InvokeDotNetMethodException")] | |
| private static partial void InvokeStaticDotNetMethodException(ILogger logger, string assemblyName, string methodIdentifier, string? callbackId, Exception exception); | |
| [LoggerMessage(4, LogLevel.Debug, "There was an error invoking the instance method '{MethodIdentifier}' on reference '{DotNetObjectReference}' with callback id '{CallbackId}'.", EventName = "InvokeDotNetMethodException")] | |
| private static partial void InvokeInstanceDotNetMethodException(ILogger logger, string methodIdentifier, long dotNetObjectReference, string? callbackId, Exception exception); | |
| [LoggerMessage(3, LogLevel.Debug, "Invocation of '[{AssemblyName}]::{MethodIdentifier}' with callback id '{CallbackId}' completed successfully.", EventName = "InvokeDotNetMethodSuccess")] | |
| private static partial void InvokeStaticDotNetMethodSuccess(ILogger<RemoteJSRuntime> logger, string assemblyName, string methodIdentifier, string? callbackId); | |
| [LoggerMessage(5, LogLevel.Debug, "Invocation of '{MethodIdentifier}' on reference '{DotNetObjectReference}' with callback id '{CallbackId}' completed successfully.", EventName = "InvokeDotNetMethodSuccess")] | |
| private static partial void InvokeInstanceDotNetMethodSuccess(ILogger<RemoteJSRuntime> logger, string methodIdentifier, long dotNetObjectReference, string? callbackId); |
And a duplicate LocationChangeFailed between:
aspnetcore/src/Components/Server/src/Circuits/CircuitHost.cs
Lines 761 to 762 in 334da01
| [LoggerMessage(210, LogLevel.Debug, "Location change to '{URI}' in circuit '{CircuitId}' failed.", EventName = "LocationChangeFailed")] | |
| public static partial void LocationChangeFailed(ILogger logger, string uri, CircuitId circuitId, Exception exception); |
aspnetcore/src/Components/Server/src/Circuits/CircuitHost.cs
Lines 812 to 813 in 334da01
| [LoggerMessage(219, LogLevel.Error, "Location change to '{URI}' in circuit '{CircuitId}' failed.", EventName = "LocationChangeFailed")] | |
| public static partial void LocationChangeFailedInCircuit(ILogger logger, string uri, CircuitId circuitId, Exception exception); |
I've suppressed these warnings in #46055 for now. But we should make a conscious decision if we really want/need these EventNames to be the same, or if we should change them. My understanding is changing them is technically a breaking change, so we should be sure that they need changing if we do.