Skip to content

Commit

Permalink
Inject backtrace reporter into Logs feature
Browse files Browse the repository at this point in the history
  • Loading branch information
0xnm committed Jul 9, 2024
1 parent 07cccef commit 2f117d4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Unreleased

- [FIX] Objc attributes interop for KMP. See [#1947][]
- [FIX] Inject backtrace reporter into Logs feature. See [#1948][]

# 2.14.0 / 04-07-2024

Expand Down Expand Up @@ -711,6 +712,7 @@ Release `2.0` introduces breaking changes. Follow the [Migration Guide](MIGRATIO
[#1934]: https://github.com/DataDog/dd-sdk-ios/pull/1934
[#1938]: https://github.com/DataDog/dd-sdk-ios/pull/1938
[#1947]: https://github.com/DataDog/dd-sdk-ios/pull/1947
[#1948]: https://github.com/DataDog/dd-sdk-ios/pull/1948
[@00fa9a]: https://github.com/00FA9A
[@britton-earnin]: https://github.com/Britton-Earnin
[@hengyu]: https://github.com/Hengyu
Expand Down
3 changes: 2 additions & 1 deletion DatadogLogs/Sources/Logs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ public enum Logs {
logEventMapper: logEventMapper,
dateProvider: configuration.dateProvider,
customIntakeURL: configuration.customEndpoint,
telemetry: core.telemetry
telemetry: core.telemetry,
backtraceReporter: core.backtraceReporter
)

do {
Expand Down
12 changes: 12 additions & 0 deletions DatadogLogs/Tests/LogsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@ class LogsTests: XCTestCase {
XCTAssertTrue(Logs._internal.isEnabled(in: core))
}

func testInitializedWithBacktraceReporter() throws {
// Given
let core = FeatureRegistrationCoreMock()

// When
Logs.enable(in: core)

// Then
let logs = try XCTUnwrap(core.get(feature: LogsFeature.self))
XCTAssertNotNil(logs.backtraceReporter)
}

func testConfigurationOverrides() throws {
// Given
let customEndpoint: URL = .mockRandom()
Expand Down

0 comments on commit 2f117d4

Please sign in to comment.