Skip to content

Commit

Permalink
[iOS] Test logger storage with serial dispatch queue
Browse files Browse the repository at this point in the history
  • Loading branch information
Enda-O committed Dec 6, 2024
1 parent ac2f14d commit 6d956de
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ios/ConduitModule/Feedback/LogHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -235,20 +235,20 @@ public struct TestLog {
private class TestLoggerStorage {

private var logs = [TestLog]()
private let queue = DispatchQueue(label: "TestLoggerStorage", attributes: .concurrent)
private let queue = DispatchQueue(label: "TestLoggerStorage")

var capturedLogs: [TestLog] {
queue.sync { logs }
}

func capture(_ log: TestLog) {
queue.async(flags: .barrier) {
queue.sync {
self.logs.append(log)
}
}

func empty() {
queue.async(flags: .barrier) {
queue.sync {
self.logs.removeAll()
}
}
Expand Down

0 comments on commit 6d956de

Please # to comment.