TagNameAttribute 클래스
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
기록된 매개 변수 또는 속성에 사용할 태그 이름을 정의합니다.
public ref class TagNameAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Parameter | System.AttributeTargets.Property)]
[System.Diagnostics.Conditional("CODE_GENERATION_ATTRIBUTES")]
public sealed class TagNameAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Parameter | System.AttributeTargets.Property)>]
[<System.Diagnostics.Conditional("CODE_GENERATION_ATTRIBUTES")>]
type TagNameAttribute = class
inherit Attribute
Public NotInheritable Class TagNameAttribute
Inherits Attribute
- 상속
- 특성
예제
[LoggerMessage(1, LogLevel.Information, "My custom tag name: {my.custom.tagname}")]
public static partial void LogMyCustomTagName(
this ILogger logger,
[TagName("my.custom.tagname")] string name);
설명
기본적으로 태그 이름은 해당 매개 변수 또는 속성과 동일합니다. 이 특성을 사용하여 기본값을 재정의하고 사용자 지정 태그 이름을 제공할 수 있습니다.
생성자
| Name | Description |
|---|---|
| TagNameAttribute(String) |
TagNameAttribute 클래스의 새 인스턴스를 초기화합니다. |
속성
| Name | Description |
|---|---|
| Name |
매개 변수 또는 속성을 로깅할 때 사용할 태그의 이름을 가져옵니다. |