-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow use of overloaded methods when using LoggerMessage (#64573)
* Compute unique method names for generated code Calculates and assigns a unique LoggerMethod name as required, and uses this new unique name for generating types in the source generator. This allows using the LoggerMessageAttribute on methods that share the same name but have different method signatures. Fix #61814 * Rename MethodOverloadTestExtensions to OverloadTestExtensions Also resolves other PR feedback, an extra blank line and incorrect use of an implicit type. * Remove un-needed overload tests
- v9.0.0
- v9.0.0-rc.2.24473.5
- v9.0.0-rc.1.24431.7
- v9.0.0-preview.7.24405.7
- v9.0.0-preview.6.24327.7
- v9.0.0-preview.5.24306.7
- v9.0.0-preview.4.24266.19
- v9.0.0-preview.3.24172.9
- v9.0.0-preview.2.24128.5
- v9.0.0-preview.1.24080.9
- v8.0.11
- v8.0.10
- v8.0.8
- v8.0.7
- v8.0.6
- v8.0.5
- v8.0.4
- v8.0.3
- v8.0.2
- v8.0.1
- v8.0.0
- v8.0.0-rc.2.23479.6
- v8.0.0-rc.1.23419.4
- v8.0.0-preview.7.23375.6
- v8.0.0-preview.6.23329.7
- v8.0.0-preview.5.23280.8
- v8.0.0-preview.4.23259.5
- v8.0.0-preview.3.23174.8
- v8.0.0-preview.2.23128.3
- v8.0.0-preview.1.23110.8
- v7.0.20
- v7.0.19
- v7.0.18
- v7.0.17
- v7.0.16
- v7.0.15
- v7.0.14
- v7.0.13
- v7.0.12
- v7.0.11
- v7.0.10
- v7.0.9
- v7.0.8
- v7.0.7
- v7.0.5
- v7.0.4
- v7.0.3
- v7.0.2
- v7.0.1
- v7.0.0
- v7.0.0-rc.2.22472.3
- v7.0.0-rc.1.22426.10
- v7.0.0-preview.7.22375.6
- v7.0.0-preview.6.22324.4
- v7.0.0-preview.5.22301.12
- v7.0.0-preview.4.22229.4
- v7.0.0-preview.3.22175.4
- v7.0.0-preview.2.22152.2
- release/7.0
1 parent
77b69b8
commit 2e35741
Showing
4 changed files
with
59 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...tests/Microsoft.Extensions.Logging.Generators.Tests/TestClasses/OverloadTestExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace Microsoft.Extensions.Logging.Generators.Tests.TestClasses | ||
{ | ||
internal static partial class OverloadTestExtensions | ||
{ | ||
[LoggerMessage(EventId = 0, Level = LogLevel.Trace, Message = "M0{p0}")] | ||
public static partial void M0(ILogger logger, int p0); | ||
|
||
[LoggerMessage(EventId = 1, Level = LogLevel.Trace, Message = "M0{p0}")] | ||
public static partial void M0(ILogger logger, string p0); | ||
} | ||
} |