Skip to content

Commit

Permalink
test: Remove noisy logs for TestLogTests (#2909)
Browse files Browse the repository at this point in the history
Don't call super when running testLoggingFromMulitpleThreads to avoid
spamming the test logs.
  • Loading branch information
philipphofmann authored Apr 17, 2023
1 parent 326b7eb commit 3e7aa41
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Tests/SentryTests/TestLogOutput.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ class TestLogOutput: SentryLogOutput {

private var _loggedMessages: [String] = []

var callSuperWhenLogging = true

var loggedMessages: [String] {
get {
queue.sync {
Expand All @@ -15,7 +17,9 @@ class TestLogOutput: SentryLogOutput {
}

override func log(_ message: String) {
super.log(message)
if callSuperWhenLogging {
super.log(message)
}
queue.async(flags: .barrier) {
self._loggedMessages.append(message)
}
Expand All @@ -26,6 +30,7 @@ class TestLogOutPutTests: XCTestCase {

func testLoggingFromMulitpleThreads() {
let sut = TestLogOutput()
sut.callSuperWhenLogging = false
testConcurrentModifications(writeWork: { i in
sut.log("Some message \(i)")
}, readWork: {
Expand Down

0 comments on commit 3e7aa41

Please sign in to comment.