Skip to content

Commit 159ee9d

Browse files
authored
use EventKeywords.All rather than (-1) (#2227)
1 parent c84af7c commit 159ee9d

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/OpenTelemetry.Api/Internal/OpenTelemetryApiEventSource.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public void ActivityContextExtractException(string format, Exception ex)
4040
[NonEvent]
4141
public void BaggageExtractException(string format, Exception ex)
4242
{
43-
if (this.IsEnabled(EventLevel.Warning, (EventKeywords)(-1)))
43+
if (this.IsEnabled(EventLevel.Warning, EventKeywords.All))
4444
{
4545
this.FailedToExtractBaggage(format, ex.ToInvariantString());
4646
}
@@ -49,7 +49,7 @@ public void BaggageExtractException(string format, Exception ex)
4949
[NonEvent]
5050
public void TracestateExtractException(Exception ex)
5151
{
52-
if (this.IsEnabled(EventLevel.Warning, (EventKeywords)(-1)))
52+
if (this.IsEnabled(EventLevel.Warning, EventKeywords.All))
5353
{
5454
this.TracestateExtractError(ex.ToInvariantString());
5555
}
@@ -58,7 +58,7 @@ public void TracestateExtractException(Exception ex)
5858
[NonEvent]
5959
public void TracestateKeyIsInvalid(ReadOnlySpan<char> key)
6060
{
61-
if (this.IsEnabled(EventLevel.Warning, (EventKeywords)(-1)))
61+
if (this.IsEnabled(EventLevel.Warning, EventKeywords.All))
6262
{
6363
this.TracestateKeyIsInvalid(key.ToString());
6464
}
@@ -67,7 +67,7 @@ public void TracestateKeyIsInvalid(ReadOnlySpan<char> key)
6767
[NonEvent]
6868
public void TracestateValueIsInvalid(ReadOnlySpan<char> value)
6969
{
70-
if (this.IsEnabled(EventLevel.Warning, (EventKeywords)(-1)))
70+
if (this.IsEnabled(EventLevel.Warning, EventKeywords.All))
7171
{
7272
this.TracestateValueIsInvalid(value.ToString());
7373
}

src/OpenTelemetry.Exporter.Prometheus/Implementation/PrometheusExporterEventSource.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ internal class PrometheusExporterEventSource : EventSource
3131
[NonEvent]
3232
public void FailedExport(Exception ex)
3333
{
34-
if (this.IsEnabled(EventLevel.Error, (EventKeywords)(-1)))
34+
if (this.IsEnabled(EventLevel.Error, EventKeywords.All))
3535
{
3636
this.FailedExport(ex.ToInvariantString());
3737
}
@@ -40,7 +40,7 @@ public void FailedExport(Exception ex)
4040
[NonEvent]
4141
public void FailedShutdown(Exception ex)
4242
{
43-
if (this.IsEnabled(EventLevel.Error, (EventKeywords)(-1)))
43+
if (this.IsEnabled(EventLevel.Error, EventKeywords.All))
4444
{
4545
this.FailedShutdown(ex.ToInvariantString());
4646
}
@@ -49,7 +49,7 @@ public void FailedShutdown(Exception ex)
4949
[NonEvent]
5050
public void CanceledExport(Exception ex)
5151
{
52-
if (this.IsEnabled(EventLevel.Error, (EventKeywords)(-1)))
52+
if (this.IsEnabled(EventLevel.Error, EventKeywords.All))
5353
{
5454
this.CanceledExport(ex.ToInvariantString());
5555
}

src/OpenTelemetry.Exporter.Zipkin/Implementation/ZipkinExporterEventSource.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public void FailedExport(Exception ex)
4040
[NonEvent]
4141
public void FailedEndpointInitialization(Exception ex)
4242
{
43-
if (this.IsEnabled(EventLevel.Error, (EventKeywords)(-1)))
43+
if (this.IsEnabled(EventLevel.Error, EventKeywords.All))
4444
{
4545
this.FailedEndpointInitialization(ex.ToInvariantString());
4646
}

0 commit comments

Comments
 (0)