Skip to content

Commit 82a8f93

Browse files
committed
Fix compilation (of the tests) on old Swift versions
1 parent 4da0ac0 commit 82a8f93

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Tests/CLTLoggerTests/CLTLoggerTests.swift

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import XCTest
88

99
final class CLTLoggerTests : XCTestCase {
1010

11-
static let defaultBootstrapFactory: @Sendable (String) -> any LogHandler = { _ in CLTLogger(multilineMode: .allMultiline) }
12-
1311
override class func setUp() {
14-
LoggingSystem.bootstrap(Self.defaultBootstrapFactory)
12+
/* ⚠️ Also change in the testBasicLogOutputWithAllEmojiSets method if changed here.
13+
* We have not created a variable because we would have to use the @Sendable annotation, which we cannot as we support Swift 5.2. */
14+
LoggingSystem.bootstrap{ _ in CLTLogger(multilineMode: .allMultiline) }
1515
}
1616

1717
/* From <https://apple.github.io/swift-log/docs/current/Logging/Protocols/LogHandler.html#treat-log-level-amp-metadata-as-values>. */
@@ -107,8 +107,9 @@ final class CLTLoggerTests : XCTestCase {
107107
logger.debug( "debug: Example of text at this level.")
108108
logger.trace( "trace: Example of text at this level.")
109109
}
110-
/* Reset factory. */
111-
LoggingSystem.bootstrapInternal(Self.defaultBootstrapFactory)
110+
/* Reset factory.
111+
* ⚠️ Also change in the setUp method if changed here. */
112+
LoggingSystem.bootstrapInternal{ _ in CLTLogger(multilineMode: .allMultiline) }
112113
}
113114

114115
}

0 commit comments

Comments
 (0)