From: Marek Safar Date: Wed, 23 Jun 2021 12:56:44 +0000 (+0200) Subject: Respect EventSource::IsSupported setting in more codepaths (#51977) X-Git-Tag: submit/tizen/20210909.063632~628 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9039c7764e989d97e59db4982cb2b73c5179b471;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Respect EventSource::IsSupported setting in more codepaths (#51977) --- diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs index 321d60d..d6093b4 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs @@ -495,6 +495,9 @@ namespace System.Diagnostics.Tracing /// public override string ToString() { + if (!IsSupported) + return base.ToString()!; + return SR.Format(SR.EventSource_ToString, Name, Guid); }