Skip to content

Commit 9039c77

Browse files
authored
Respect EventSource::IsSupported setting in more codepaths (#51977)
1 parent 56b3751 commit 9039c77

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing

src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,9 @@ public static void SendCommand(EventSource eventSource, EventCommand command, ID
495495
/// </summary>
496496
public override string ToString()
497497
{
498+
if (!IsSupported)
499+
return base.ToString()!;
500+
498501
return SR.Format(SR.EventSource_ToString, Name, Guid);
499502
}
500503

0 commit comments

Comments
 (0)