-
Notifications
You must be signed in to change notification settings - Fork 2
Breaking Changes
A change was made to the available options and the default value, to better support the default means of generation used by the Microsoft Logging/ Telemetry source generators.
Previously, the default event name generated for the logging method also included a trimmed down version of the class name, and the method name combined.
For example:
[Logger]
interface IServiceTelemetry
{
void LogAThing(int theThing);
}In v1 and v2, the default event name for LogAThing would have been Service.LogAThing. As of v3, the default has changed to LogAThing.
This is supported by the following changes to the LogPrefixType's field.
| Field | Old Behaviour | New Behaviour |
|---|---|---|
Default |
Generated a prefix based on the generated class name. | Generates no suffix. |
NoSuffix |
Generated no suffix. | Field removed |
TrimmedClassName |
Previously the default behaviour. | New field, generates a suffix based on the generated class name. |
To return to the previous behaviour, set one of the following:
-
LoggerGenerationAttribute.DefaultPrefixTypetoLogPrefixType.TrimmedClassNameat the assembly level. -
LoggerAttribute.PrefixTypetoLogPrefixType.TrimmedClassNameat the interface level.
Important
Consider helping children around the world affected by conflict. You can donate any amount to War Child here - any amount can help save a life.
Purview Telemetry Source Generator v4.0.0-prerelease.1 | Home | Getting Started | FAQ | Breaking Changes | GitHub