diff --git a/Sources/Clickstream/Dependency/Clickstream/Analytics/EventRecorder.swift b/Sources/Clickstream/Dependency/Clickstream/Analytics/EventRecorder.swift index 1330ad5..6bb4293 100644 --- a/Sources/Clickstream/Dependency/Clickstream/Analytics/EventRecorder.swift +++ b/Sources/Clickstream/Dependency/Clickstream/Analytics/EventRecorder.swift @@ -28,6 +28,7 @@ class EventRecorder: AnalyticsEventRecording { let dbUtil: ClickstreamDBProtocol private(set) var queue: OperationQueue private(set) var bundleSequenceId: Int + var allEventJson: String = "" init(clickstream: ClickstreamContext) throws { self.clickstream = clickstream @@ -51,6 +52,8 @@ class EventRecorder: AnalyticsEventRecording { if clickstream.configuration.isLogEvents { setLogLevel(logLevel: LogLevel.debug) log.debug("Saved event: \(event.eventType)\n\(eventObject.toPrettierJsonString())") + allEventJson.append("Saved event \(event.eventType):\(eventObject.toJsonString())\n") + UIPasteboard.general.string = allEventJson } while try dbUtil.getTotalSize() > Constants.maxDbSize { let events = try dbUtil.getEventsWith(limit: 5) @@ -111,6 +114,8 @@ class EventRecorder: AnalyticsEventRecording { } try dbUtil.deleteBatchEvents(lastEventId: batchEvent.lastEventId) log.debug("Send \(batchEvent.eventCount) events") + allEventJson.append("Send \(batchEvent.eventCount) events\n") + UIPasteboard.general.string = allEventJson totalEventSend += batchEvent.eventCount submissions += 1 } while submissions < Constants.maxSubmissionsAllowed