Skip to content

Commit 5918fc4

Browse files
committed
Fix "AppleUnifiedLogger" registration unit tests.
- Corrected `if #available` statement. - Fixed fragile `testLoggingTwiceWithTheSameLoggerNameLogsMessagesCorrectly` Also: - Fixed warning about "PRODUCT_BUNDLE_IDENTIFIER" and info plist.
1 parent 27e4ccf commit 5918fc4

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

Log4swift.xcodeproj/project.pbxproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,7 @@
10921092
IPHONEOS_DEPLOYMENT_TARGET = 12.1;
10931093
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
10941094
MACOSX_DEPLOYMENT_TARGET = 10.12;
1095-
PRODUCT_BUNDLE_IDENTIFIER = fr.duquennoy.log4swiftTests;
1095+
PRODUCT_BUNDLE_IDENTIFIER = fr.duquennoy.log4swiftPerfTests;
10961096
PRODUCT_NAME = "$(TARGET_NAME)";
10971097
};
10981098
name = Debug;
@@ -1105,7 +1105,7 @@
11051105
IPHONEOS_DEPLOYMENT_TARGET = 12.1;
11061106
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
11071107
MACOSX_DEPLOYMENT_TARGET = 10.12;
1108-
PRODUCT_BUNDLE_IDENTIFIER = fr.duquennoy.log4swiftTests;
1108+
PRODUCT_BUNDLE_IDENTIFIER = fr.duquennoy.log4swiftPerfTests;
11091109
PRODUCT_NAME = "$(TARGET_NAME)";
11101110
};
11111111
name = Release;

Log4swift/Appenders/AppendersRegistry.swift

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ public struct AppendersRegistry {
2121
ASLAppender.self,
2222
SystemAppender.self
2323
]
24-
if #available(macOS 12.0, *),
25-
#available(iOSApplicationExtension 10.0, *) {
24+
if #available(macOS 10.12, iOSApplicationExtension 10.0, *) {
2625
appenders.append(AppleUnifiedLoggerAppender.self)
2726
}
2827
return appenders

Log4swiftTests/Appenders/AppleUnifiedLoggerAppenderTests.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class AppleUnifiedLoggerAppenderTests: XCTestCase {
3232
func testLoggingTwiceWithTheSameLoggerNameLogsMessagesCorrectly() throws {
3333
let infoDictionary = [LogInfoKeys.LoggerName: testLoggerName]
3434
let appender = AppleUnifiedLoggerAppender("testAppender")
35-
let logMessage = "Test info message" // " + UUID().uuidString
35+
let logMessage = "Test info message " + UUID().uuidString
3636

3737
// Execute
3838
appender.log(logMessage, level: LogLevel.Info, info: infoDictionary)

Log4swiftTests/Info.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<key>CFBundleExecutable</key>
88
<string>$(EXECUTABLE_NAME)</string>
99
<key>CFBundleIdentifier</key>
10-
<string>fr.duquennoy.$(PRODUCT_NAME:rfc1034identifier)</string>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
1111
<key>CFBundleInfoDictionaryVersion</key>
1212
<string>6.0</string>
1313
<key>CFBundleName</key>

0 commit comments

Comments
 (0)