Skip to content

Commit 92a658a

Browse files
authored
Backtrace agent support (#118)
* Backtrace agent support * Do not read application version as 'backtrace.version'
1 parent 3fddf0c commit 92a658a

File tree

2 files changed

+5
-16
lines changed

2 files changed

+5
-16
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Version 2.0.1
44
- Added application.session and application.version attribute as defaults - no matter if the metrics integration is enabled or not.
55
- Added application.build attribute that represents an app build version.
6+
- Added backtrace.agent attribute that represents current agent name.
67

78
## Version 2.0.0
89
- Adds Swift Package Manager support

Sources/Features/Attributes/DefaultAttributes.swift

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -207,26 +207,14 @@ struct LibInfo: AttributesSource {
207207
private static let applicationGuidKey = "backtrace.unique.user.identifier"
208208
private static let applicationLangName = "backtrace-cocoa"
209209

210-
var backtraceVersion: String? {
211-
212-
#if SWIFT_PACKAGE
213-
if let build = Bundle.main.infoDictionary?["CFBundleShortVersionString"] {
214-
return build as? String
215-
}
216-
#else
217-
if let bundle = Bundle(identifier: "Backtrace.io.Backtrace"),
218-
let build = bundle.infoDictionary?["CFBundleShortVersionString"] {
219-
return build as? String
220-
}
221-
#endif
222-
return nil
223-
}
224-
210+
var backtraceVersion = "2.0.1"
211+
225212
var immutable: [String: Any?] {
226213
return ["guid": LibInfo.guid(store: UserDefaultsStore.self).uuidString,
227214
"lang.name": LibInfo.applicationLangName,
228215
"lang.version": backtraceVersion,
229-
"backtrace.version": backtraceVersion]
216+
"backtrace.version": backtraceVersion,
217+
"backtrace.agent": "backtrace-cocoa"]
230218
}
231219

232220
static private func guid(store: UserDefaultsStore.Type) -> UUID {

0 commit comments

Comments
 (0)