DiagnosticSource.Write 메서드

정의

오버로드

Name Description
Write(String, Object)

복잡한 페이로드를 로깅하는 일반적인 방법을 제공합니다.

Write<T>(String, T)

복잡한 페이로드를 로깅하는 일반적인 방법을 제공합니다.

Write(String, Object)

Source:
DiagnosticSource.cs
Source:
DiagnosticSource.cs
Source:
DiagnosticSource.cs
Source:
DiagnosticSource.cs
Source:
DiagnosticSource.cs
Source:
DiagnosticSource.cs
Source:
DiagnosticSource.cs

복잡한 페이로드를 로깅하는 일반적인 방법을 제공합니다.

public:
 abstract void Write(System::String ^ name, System::Object ^ value);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The type of object being written to DiagnosticSource cannot be discovered statically.")]
public abstract void Write(string name, object? value);
public abstract void Write(string name, object? value);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The type of object being written to DiagnosticSource cannot be discovered statically.")]
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("DiagnosticSource may require creating new generic types or methods, which requires creating code at runtime. This may not work when AOT compiling.")]
public abstract void Write(string name, object? value);
public abstract void Write(string name, object value);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The type of object being written to DiagnosticSource cannot be discovered statically.")>]
abstract member Write : string * obj -> unit
abstract member Write : string * obj -> unit
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The type of object being written to DiagnosticSource cannot be discovered statically.")>]
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("DiagnosticSource may require creating new generic types or methods, which requires creating code at runtime. This may not work when AOT compiling.")>]
abstract member Write : string * obj -> unit
Public MustOverride Sub Write (name As String, value As Object)

매개 변수

name
String

작성 중인 이벤트의 이름입니다.

value
Object

이벤트에 대한 페이로드로 전달되는 값을 나타내는 개체입니다. 여러 하위 값이 포함된 익명 형식인 경우가 많습니다.

특성

설명

각 알림에는 알림을 식별하는 이름과 알림에 전달할 임의의 정보를 제공하는 개체(일반적으로 익명 형식)가 지정됩니다.

name 는 짧아야 합니다. 모호성을 name 피해야 하는 경우가 아니면 정규화된 이름을 사용하지 마세요. 전역적으로 고유해야 하므로 일반적으로 componentName 및 eventName이 10자 미만의 문자열인 componentName.eventName은 적절한 손상입니다.

구성 요소 이름에는 점이 있으므로 알림 이름 . 에는 없어야 하며, 둘 다 점이 있으면 모호성이 발생합니다. 대신 사용하는 _ 것이 좋습니다.

수신기가 문자열 접두사를 사용하여 그룹을 필터링한다고 가정합니다. 따라서 구성 요소 이름의 계층 구조를 갖는 것이 좋습니다.

적용 대상

Write<T>(String, T)

Source:
DiagnosticSource.cs
Source:
DiagnosticSource.cs
Source:
DiagnosticSource.cs
Source:
DiagnosticSource.cs
Source:
DiagnosticSource.cs
Source:
DiagnosticSource.cs

복잡한 페이로드를 로깅하는 일반적인 방법을 제공합니다.

public:
generic <typename T>
 void Write(System::String ^ name, T value);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Only the properties of the T type will be preserved. Properties of referenced types and properties of derived types may be trimmed.")]
public void Write<T>(string name, T value);
public void Write<T>(string name, T value);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Only the properties of the T type will be preserved. Properties of referenced types and properties of derived types may be trimmed.")>]
member this.Write : string * 'T -> unit
member this.Write : string * 'T -> unit
Public Sub Write(Of T) (name As String, value As T)

형식 매개 변수

T

이벤트에 대한 페이로드로 전달되는 값의 형식입니다.

매개 변수

name
String

작성 중인 이벤트의 이름입니다.

value
T

이벤트에 대한 페이로드로 전달되는 값을 나타내는 개체입니다. 여러 하위 값이 포함된 익명 형식인 경우가 많습니다.

특성

적용 대상