Skip to content

Commit 139d324

Browse files
committed
Code converted to swift 4 syntax, project updated to xcode 9 recommended settings
1 parent 524e4e6 commit 139d324

16 files changed

+73
-54
lines changed

Log4swift.xcodeproj/project.pbxproj

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
/* Begin PBXFileReference section */
141141
021136B21B55A85A000954DF /* ValidCompleteConfiguration.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = ValidCompleteConfiguration.plist; sourceTree = "<group>"; };
142142
021DCE481BE17C4F0026633E /* Logger-AsynchronicityTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = "Logger-AsynchronicityTests.swift"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
143-
0237CF351B2E220F004D5B9F /* SimpleUsage-OSX.playground */ = {isa = PBXFileReference; lastKnownFileType = file.playground; path = "SimpleUsage-OSX.playground"; sourceTree = "<group>"; };
143+
0237CF351B2E220F004D5B9F /* SimpleUsage-OSX.playground */ = {isa = PBXFileReference; lastKnownFileType = file.playground; path = "SimpleUsage-OSX.playground"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
144144
0241A2D71C32ACD400A624CF /* FileObserver.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FileObserver.swift; sourceTree = "<group>"; };
145145
024E2E031B3F41D500457304 /* XCTestCase+noThrow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "XCTestCase+noThrow.swift"; sourceTree = "<group>"; };
146146
024FD79B1B2DD3FE00A8609C /* String+utilities.swift */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.swift; path = "String+utilities.swift"; sourceTree = "<group>"; };
@@ -164,7 +164,7 @@
164164
02B61A641B56D1F200C683D8 /* log4swiftPerformanceTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "log4swiftPerformanceTests-Info.plist"; sourceTree = "<group>"; };
165165
02B8F61F1B30A1DD0077A8A6 /* FileAppender.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FileAppender.swift; sourceTree = "<group>"; };
166166
02B8F6221B30B26A0077A8A6 /* FileAppenderTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FileAppenderTests.swift; sourceTree = "<group>"; };
167-
02D87E431B34BBCC0089A222 /* SoftwareConfiguration-OSX.playground */ = {isa = PBXFileReference; lastKnownFileType = file.playground; path = "SoftwareConfiguration-OSX.playground"; sourceTree = "<group>"; };
167+
02D87E431B34BBCC0089A222 /* SoftwareConfiguration-OSX.playground */ = {isa = PBXFileReference; lastKnownFileType = file.playground; path = "SoftwareConfiguration-OSX.playground"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
168168
02DE4EE11C3708F100030042 /* FileObserverTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FileObserverTests.swift; sourceTree = "<group>"; };
169169
02DE4EE31C370A4600030042 /* XCTestCase+fileAdditions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "XCTestCase+fileAdditions.swift"; sourceTree = "<group>"; };
170170
02F4E8681B3A0354004AB9EA /* NSLoggerAppender.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NSLoggerAppender.swift; sourceTree = "<group>"; };
@@ -611,24 +611,24 @@
611611
isa = PBXProject;
612612
attributes = {
613613
LastSwiftUpdateCheck = 0700;
614-
LastUpgradeCheck = 0800;
614+
LastUpgradeCheck = 0900;
615615
ORGANIZATIONNAME = jerome;
616616
TargetAttributes = {
617617
02664C091B2CE96500B695DE = {
618618
CreatedOnToolsVersion = 7.0;
619-
LastSwiftMigration = 0810;
619+
LastSwiftMigration = 0900;
620620
};
621621
02664C131B2CE96500B695DE = {
622622
CreatedOnToolsVersion = 7.0;
623-
LastSwiftMigration = 0810;
623+
LastSwiftMigration = 0900;
624624
};
625625
5E3F86D71DC25E2F008F296C = {
626626
CreatedOnToolsVersion = 8.0;
627627
ProvisioningStyle = Automatic;
628628
};
629629
5EF80A901B7A172400A5F07A = {
630630
CreatedOnToolsVersion = 6.3.2;
631-
LastSwiftMigration = 0810;
631+
LastSwiftMigration = 0900;
632632
};
633633
FFB050771ECDBF9E008466C6 = {
634634
CreatedOnToolsVersion = 8.3;
@@ -865,13 +865,21 @@
865865
CLANG_CXX_LIBRARY = "libc++";
866866
CLANG_ENABLE_MODULES = YES;
867867
CLANG_ENABLE_OBJC_ARC = YES;
868+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
868869
CLANG_WARN_BOOL_CONVERSION = YES;
870+
CLANG_WARN_COMMA = YES;
869871
CLANG_WARN_CONSTANT_CONVERSION = YES;
870872
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
871873
CLANG_WARN_EMPTY_BODY = YES;
872874
CLANG_WARN_ENUM_CONVERSION = YES;
875+
CLANG_WARN_INFINITE_RECURSION = YES;
873876
CLANG_WARN_INT_CONVERSION = YES;
877+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
878+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
874879
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
880+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
881+
CLANG_WARN_STRICT_PROTOTYPES = YES;
882+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
875883
CLANG_WARN_UNREACHABLE_CODE = YES;
876884
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
877885
COPY_PHASE_STRIP = NO;
@@ -918,13 +926,21 @@
918926
CLANG_CXX_LIBRARY = "libc++";
919927
CLANG_ENABLE_MODULES = YES;
920928
CLANG_ENABLE_OBJC_ARC = YES;
929+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
921930
CLANG_WARN_BOOL_CONVERSION = YES;
931+
CLANG_WARN_COMMA = YES;
922932
CLANG_WARN_CONSTANT_CONVERSION = YES;
923933
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
924934
CLANG_WARN_EMPTY_BODY = YES;
925935
CLANG_WARN_ENUM_CONVERSION = YES;
936+
CLANG_WARN_INFINITE_RECURSION = YES;
926937
CLANG_WARN_INT_CONVERSION = YES;
938+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
939+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
927940
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
941+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
942+
CLANG_WARN_STRICT_PROTOTYPES = YES;
943+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
928944
CLANG_WARN_UNREACHABLE_CODE = YES;
929945
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
930946
COPY_PHASE_STRIP = NO;
@@ -969,7 +985,7 @@
969985
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
970986
PRODUCT_MODULE_NAME = "$(PROJECT_NAME:c99extidentifier)";
971987
SKIP_INSTALL = YES;
972-
SWIFT_VERSION = 3.0;
988+
SWIFT_VERSION = 4.0;
973989
SYMROOT = build;
974990
};
975991
name = Debug;
@@ -990,7 +1006,7 @@
9901006
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
9911007
PRODUCT_MODULE_NAME = "$(PROJECT_NAME:c99extidentifier)";
9921008
SKIP_INSTALL = YES;
993-
SWIFT_VERSION = 3.0;
1009+
SWIFT_VERSION = 4.0;
9941010
SYMROOT = build;
9951011
};
9961012
name = Release;
@@ -1003,7 +1019,7 @@
10031019
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
10041020
PRODUCT_BUNDLE_IDENTIFIER = fr.duquennoy.log4swiftTests;
10051021
PRODUCT_NAME = Log4swiftTests;
1006-
SWIFT_VERSION = 3.0;
1022+
SWIFT_VERSION = 4.0;
10071023
};
10081024
name = Debug;
10091025
};
@@ -1015,7 +1031,7 @@
10151031
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
10161032
PRODUCT_BUNDLE_IDENTIFIER = fr.duquennoy.log4swiftTests;
10171033
PRODUCT_NAME = Log4swiftTests;
1018-
SWIFT_VERSION = 3.0;
1034+
SWIFT_VERSION = 4.0;
10191035
};
10201036
name = Release;
10211037
};
@@ -1099,7 +1115,7 @@
10991115
isa = XCBuildConfiguration;
11001116
buildSettings = {
11011117
CODE_SIGN_IDENTITY = "iPhone Developer";
1102-
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
1118+
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
11031119
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
11041120
DEFINES_MODULE = YES;
11051121
DEVELOPMENT_TEAM = "";
@@ -1120,7 +1136,7 @@
11201136
PROVISIONING_PROFILE = "";
11211137
SDKROOT = iphoneos;
11221138
SKIP_INSTALL = YES;
1123-
SWIFT_VERSION = 3.0;
1139+
SWIFT_VERSION = 4.0;
11241140
SYMROOT = build;
11251141
TARGETED_DEVICE_FAMILY = "1,2";
11261142
};
@@ -1130,7 +1146,7 @@
11301146
isa = XCBuildConfiguration;
11311147
buildSettings = {
11321148
CODE_SIGN_IDENTITY = "iPhone Developer";
1133-
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
1149+
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
11341150
DEFINES_MODULE = YES;
11351151
DEVELOPMENT_TEAM = "";
11361152
DYLIB_COMPATIBILITY_VERSION = 1;
@@ -1145,7 +1161,7 @@
11451161
PROVISIONING_PROFILE = "";
11461162
SDKROOT = iphoneos;
11471163
SKIP_INSTALL = YES;
1148-
SWIFT_VERSION = 3.0;
1164+
SWIFT_VERSION = 4.0;
11491165
SYMROOT = build;
11501166
TARGETED_DEVICE_FAMILY = "1,2";
11511167
VALIDATE_PRODUCT = YES;

Log4swift.xcodeproj/xcshareddata/xcschemes/log4swift-OSX.xcscheme

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0800"
3+
LastUpgradeVersion = "0900"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,6 +26,7 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
language = ""
2930
shouldUseLaunchSchemeArgsEnv = "YES"
3031
codeCoverageEnabled = "YES">
3132
<Testables>
@@ -56,6 +57,7 @@
5657
buildConfiguration = "Debug"
5758
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
5859
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
60+
language = ""
5961
launchStyle = "0"
6062
useCustomWorkingDirectory = "NO"
6163
ignoresPersistentStateOnLaunch = "NO"

Log4swift.xcodeproj/xcshareddata/xcschemes/log4swift-iOS.xcscheme

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0800"
3+
LastUpgradeVersion = "0900"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -40,6 +40,7 @@
4040
buildConfiguration = "Debug"
4141
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4242
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
43+
language = ""
4344
shouldUseLaunchSchemeArgsEnv = "YES">
4445
<Testables>
4546
<TestableReference
@@ -69,6 +70,7 @@
6970
buildConfiguration = "Debug"
7071
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
7172
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
73+
language = ""
7274
launchStyle = "0"
7375
useCustomWorkingDirectory = "NO"
7476
ignoresPersistentStateOnLaunch = "NO"

Log4swift.xcodeproj/xcshareddata/xcschemes/log4swiftPerformanceTests.xcscheme

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0800"
3+
LastUpgradeVersion = "0900"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,6 +26,7 @@
2626
buildConfiguration = "Release"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
language = ""
2930
shouldUseLaunchSchemeArgsEnv = "YES">
3031
<Testables>
3132
<TestableReference
@@ -55,6 +56,7 @@
5556
buildConfiguration = "Release"
5657
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
5758
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
59+
language = ""
5860
launchStyle = "0"
5961
useCustomWorkingDirectory = "NO"
6062
ignoresPersistentStateOnLaunch = "NO"

Log4swift/Errors.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ import Foundation
2222

2323
extension NSError {
2424
class func Log4swiftError(description: String) -> NSError {
25-
return NSError(domain: "Log4swift", code: 0, userInfo: [(NSLocalizedFailureReasonErrorKey as String) : description as NSString, NSLocalizedDescriptionKey as NSString: description as NSString])
25+
return NSError(domain: "Log4swift", code: 0, userInfo: [(NSLocalizedFailureReasonErrorKey as String) : description as NSString, (NSLocalizedDescriptionKey as NSString) as String: description as NSString])
2626
}
2727
}

Log4swift/Formatters/PatternFormatter.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,7 @@ Available markers are :
213213
}
214214
let buffer = UnsafeMutablePointer<Int8>.allocate(capacity: 80)
215215
strftime(buffer, 80, format , date)
216-
result = NSString(bytes: buffer, length: Int(strlen(buffer)), encoding: String.Encoding.utf8.rawValue) as! String
217-
buffer.deinitialize()
216+
result = String(bytesNoCopy: buffer, length: strlen(buffer), encoding: .utf8, freeWhenDone: true) ?? "error"
218217

219218
return processCommonParameters(result, parameters: parameters)
220219
}

Log4swift/LoggerFactory.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,13 @@ The logger factory is responsible for
7676
if let loggerFromCache = self.loggers[identifierToFind] {
7777
foundLogger = loggerFromCache
7878
} else {
79-
var reducedIdentifier = identifierToFind.stringByRemovingLastComponent(withDelimiter: ".")
79+
var reducedIdentifier = identifierToFind.stringByRemovingLastComponent(withDelimiter: ".") ?? ""
8080
var loggerToCopy = self.rootLogger
8181
while (loggerToCopy === self.rootLogger && !reducedIdentifier.isEmpty) {
82-
if let loggerFromCache = self.loggers[reducedIdentifier] {
82+
if let loggerFromCache = self.loggers[String(reducedIdentifier)] {
8383
loggerToCopy = loggerFromCache
8484
}
85-
reducedIdentifier = reducedIdentifier.stringByRemovingLastComponent(withDelimiter: ".")
85+
reducedIdentifier = reducedIdentifier.stringByRemovingLastComponent(withDelimiter: ".") ?? ""
8686
}
8787

8888
foundLogger = Logger(parentLogger: loggerToCopy, identifier: identifierToFind)

Log4swift/Utilities/Array+utilities.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
import Foundation
2222

2323
extension Array {
24-
public func find(filter:(Array.Generator.Element) -> Bool) -> Element? {
24+
public func find(filter:(Array.Iterator.Element) -> Bool) -> Element? {
2525
if let itemIndex = self.index(where: filter) {
2626
return self[itemIndex]
2727
}
2828
return nil
2929
}
30-
}
30+
}

Log4swift/Utilities/Class+utilities.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ internal struct ClassInfo {
4848
let classList = objc_copyClassList(&count)!
4949

5050
for i in 0..<Int(count) {
51-
let classInfo = ClassInfo(classList[i]!)
51+
let classInfo = ClassInfo(classList[i])
5252
if classInfo.isSubclass(of: self) {
5353
subclassList.append(classInfo)
5454
}

Log4swift/Utilities/String+utilities.swift

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,20 @@
1818
// limitations under the License.
1919
//
2020

21-
extension String {
21+
extension StringProtocol {
2222
/// Return a new string by removing everything after the last occurence of the provided marker and including the marker.
2323
/// If the marker is not found, an empty string is returned.
24-
public func stringByRemovingLastComponent(withDelimiter delimiter: String) -> String {
25-
let markerIndex = self.range(of: delimiter, options: NSString.CompareOptions.backwards, range: nil)
24+
public func stringByRemovingLastComponent(withDelimiter delimiter: String) -> SubSequence? {
25+
guard let markerIndex = self.reversed().index(of: Character(delimiter)) else { return nil }
26+
let endIndex = self.index(markerIndex.base, offsetBy: -1)
2627

27-
let result: String
28-
if let markerIndex = markerIndex {
29-
result = self.substring(to: markerIndex.lowerBound)
30-
} else {
31-
result = ""
32-
}
28+
let result = self[self.startIndex..<endIndex]
3329
return result
3430
}
3531

32+
}
33+
34+
extension String {
3635
public func format(args: [CVarArg]) -> String {
3736
guard args.count > 0 else {
3837
return self
@@ -42,8 +41,7 @@ extension String {
4241
NSString(format: self, arguments: argsListPointer) as String
4342
}
4443
}
45-
46-
44+
4745
/// Pads string left or right to a certain width.
4846
///
4947
/// :parameter: width: The width of the final string. Positive values left-justify the value,
@@ -62,9 +60,9 @@ extension String {
6260

6361
if self.characters.count > abs(width) {
6462
if width < 0 {
65-
paddedString = self.substring(from: self.index(self.endIndex, offsetBy: width))
63+
paddedString = String(self.suffix(abs(width)))
6664
} else {
67-
paddedString = self.substring(to: self.index(self.startIndex, offsetBy: width))
65+
paddedString = String(self.prefix(width))
6866
}
6967
}
7068

Log4swiftTests/Appenders/StdOutAppenderTests.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -520,13 +520,13 @@ class StdOutAppenderTests: XCTestCase {
520520
var stringContent: String?
521521

522522
if #available(OSX 10.10, *) {
523-
DispatchQueue.global().async { () -> Void in
524-
let data = fileHandle.availableData
525-
stringContent = NSString(data: data, encoding: String.Encoding.utf8.rawValue) as? String
526-
if(!expectationIsExpired) {
527-
expectation.fulfill()
528-
}
523+
DispatchQueue.global().async(execute: {
524+
let data = fileHandle.availableData
525+
stringContent = String(data: data, encoding: .utf8)
526+
if(!expectationIsExpired) {
527+
expectation.fulfill()
529528
}
529+
})
530530
} else {
531531
// Fallback on earlier versions
532532
}

Log4swiftTests/Formatters/PatternFormatterTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ class PatternFormatterTests: XCTestCase {
226226
// Validate
227227
let expectedTimestamp = Date().timeIntervalSince1970
228228
if let loggedMessageTime = TimeInterval(formattedMessage) {
229-
XCTAssertEqualWithAccuracy(loggedMessageTime, expectedTimestamp, accuracy: 1.0)
229+
XCTAssertEqual(loggedMessageTime, expectedTimestamp, accuracy: 1.0)
230230
} else {
231231
XCTAssertTrue(false, "Could not read logged time")
232232
}
@@ -555,7 +555,7 @@ class PatternFormatterTests: XCTestCase {
555555
let dateFormatter = DateFormatter()
556556
dateFormatter.dateFormat = format
557557
let decodedDate = dateFormatter.date(from: formattedMessage)
558-
XCTAssertEqualWithAccuracy(decodedDate?.timeIntervalSince1970 ?? 0.0, timestamp, accuracy: 0.01, "Formatted date '\(formattedMessage)' is not valid")
558+
XCTAssertEqual(decodedDate?.timeIntervalSince1970 ?? 0.0, timestamp, accuracy: 0.01, "Formatted date '\(formattedMessage)' is not valid")
559559
}
560560

561561
func testFormatterAppliesCocoaDateMarkerWithCurrentTimestampIfNoneIsProvided() {

Log4swiftTests/LoggerTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ class LoggerTests: XCTestCase {
593593

594594
// Validate
595595
if let loggedMessageTime = TimeInterval(appender.logMessages[0].message) {
596-
XCTAssertEqualWithAccuracy(loggedMessageTime, timestampBefore, accuracy: 1.0)
596+
XCTAssertEqual(loggedMessageTime, timestampBefore, accuracy: 1.0)
597597
} else {
598598
XCTAssertTrue(false, "Could not read logged time")
599599
}

0 commit comments

Comments
 (0)