Skip to content

Commit

Permalink
Clear global log attributes on feature stop.
Browse files Browse the repository at this point in the history
Suppress unchecked cast warnings in tests.
  • Loading branch information
fuzzybinary committed Mar 5, 2024
1 parent 7606c1c commit 4562a27
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ internal class LogsFeature(
dataWriter = NoOpDataWriter()
packageName = ""
initialized.set(false)
@Suppress("UnsafeThirdPartyFunctionCall")
attributes.clear()
}

// endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ internal class DatadogLogHandlerTest {
verify(mockRumFeature).sendEvent(
capture()
)
@Suppress("UNCHECKED_CAST")
assertThat(lastValue["attributes"] as Map<String, *>)
.containsEntry(key, value)
.containsAllEntriesOf(fakeAttributes)
Expand Down Expand Up @@ -502,6 +503,7 @@ internal class DatadogLogHandlerTest {
verify(mockRumFeature).sendEvent(
capture()
)
@Suppress("UNCHECKED_CAST")
assertThat(lastValue["attributes"] as Map<String, *>)
.containsEntry(key, value)
.containsAllEntriesOf(fakeAttributes)
Expand Down

0 comments on commit 4562a27

Please sign in to comment.