Skip to content

Commit

Permalink
Updates EmbraceSemantics to move definitions under SpanEventType
Browse files Browse the repository at this point in the history
These were incorrectly defined under `SpanType`
  • Loading branch information
atreat committed Oct 2, 2024
1 parent 2726a4c commit f4e4d3f
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class LowMemoryWarningCaptureService: CaptureService {
name: SpanEventSemantics.LowMemory.name,
timestamp: Date(),
attributes: [
SpanEventSemantics.keyEmbraceType: .string(SpanType.lowMemory.rawValue)
SpanEventSemantics.keyEmbraceType: .string(SpanEventType.lowMemory.rawValue)
]
)

Expand Down
2 changes: 1 addition & 1 deletion Sources/EmbraceCore/Capture/UX/Tap/TapCaptureService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public final class TapCaptureService: CaptureService {

var attributes: [String: AttributeValue] = [
SpanEventSemantics.Tap.keyViewName: .string(viewName),
SpanEventSemantics.keyEmbraceType: .string(SpanType.tap.rawValue)
SpanEventSemantics.keyEmbraceType: .string(SpanEventType.tap.rawValue)
]

// get coordinates
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public final class WebViewCaptureService: CaptureService {
let urlString = getUrlString(url: url)

var attributes: [String: AttributeValue] = [
SpanEventSemantics.keyEmbraceType: .string(SpanType.webView.rawValue),
SpanEventSemantics.keyEmbraceType: .string(SpanEventType.webView.rawValue),
SpanEventSemantics.WebView.keyUrl: .string(urlString)
]

Expand Down
2 changes: 1 addition & 1 deletion Sources/EmbraceCore/Public/Events/Breadcrumb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class Breadcrumb: NSObject, SpanEvent {
self.timestamp = timestamp
self.attributes = attributes
self.attributes[SpanEventSemantics.Bradcrumb.keyMessage] = .string(message)
self.attributes[SpanEventSemantics.keyEmbraceType] = .string(SpanType.breadcrumb.rawValue)
self.attributes[SpanEventSemantics.keyEmbraceType] = .string(SpanEventType.breadcrumb.rawValue)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class PushNotificationEvent: NSObject, SpanEvent {
var dict: [String: AttributeValue] = [:]

// set types
dict[SpanEventSemantics.keyEmbraceType] = .string(SpanType.pushNotification.rawValue)
dict[SpanEventSemantics.keyEmbraceType] = .string(SpanEventType.pushNotification.rawValue)
dict[SpanEventSemantics.PushNotification.keyType] =
isSilent(userInfo: apsDict) ?
.string(SpanEventSemantics.PushNotification.silentType) :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import EmbraceCommonInternal

public extension SpanType {
static let breadcrumb = SpanType(system: "breadcrumb")
public extension SpanEventType {
static let breadcrumb = SpanEventType(system: "breadcrumb")
}

public extension SpanEventSemantics {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
//
import EmbraceCommonInternal

public extension SpanType {
static let lowMemory = SpanType(system: "low_memory")
public extension SpanEventType {
static let lowMemory = SpanEventType(system: "low_memory")
}

public extension SpanEventSemantics {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import EmbraceCommonInternal

public extension SpanType {
static let pushNotification = SpanType(system: "push_notification")
public extension SpanEventType {
static let pushNotification = SpanEventType(system: "push_notification")
}

public extension SpanEventSemantics {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import EmbraceCommonInternal

public extension SpanType {
static let tap = SpanType(ux: "tap")
public extension SpanEventType {
static let tap = SpanEventType(ux: "tap")
}

public extension SpanEventSemantics {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import EmbraceCommonInternal

public extension SpanType {
static let webView = SpanType(ux: "webview")
public extension SpanEventType {
static let webView = SpanEventType(ux: "webview")
}

public extension SpanEventSemantics {
Expand Down

0 comments on commit f4e4d3f

Please sign in to comment.