mirror of
https://github.com/wnagrodzki/SwiftLogger.git
synced 2025-04-07 13:01:51 +02:00
Merge branch 'release/1.0.1'
This commit is contained in:
commit
003bcb006d
5 changed files with 13 additions and 11 deletions
|
@ -1,5 +1,5 @@
|
|||
language: swift
|
||||
osx_image: xcode10
|
||||
osx_image: xcode10.2
|
||||
xcode_project: Logger.xcodeproj
|
||||
script: xcodebuild test -project Logger.xcodeproj -scheme Logger -destination 'platform=iOS Simulator,name=iPhone XS,OS=12.0'
|
||||
script: xcodebuild test -project Logger.xcodeproj -scheme Logger -destination 'platform=iOS Simulator,name=iPhone XS,OS=12.2'
|
||||
after_success: bash <(curl -s https://codecov.io/bash)
|
|
@ -210,10 +210,11 @@
|
|||
TargetAttributes = {
|
||||
2E58D35921316C3500BEF81A = {
|
||||
CreatedOnToolsVersion = 10.0;
|
||||
LastSwiftMigration = 1020;
|
||||
};
|
||||
2EBF4B392122AA34008E4117 = {
|
||||
CreatedOnToolsVersion = 10.0;
|
||||
LastSwiftMigration = 1000;
|
||||
LastSwiftMigration = 1020;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -223,6 +224,7 @@
|
|||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = 2EBF4B312122AA34008E4117;
|
||||
productRefGroup = 2EBF4B3B2122AA34008E4117 /* Products */;
|
||||
|
@ -299,7 +301,7 @@
|
|||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.wnagrodzki.UnitTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 4.2;
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Debug;
|
||||
|
@ -316,7 +318,7 @@
|
|||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.wnagrodzki.UnitTests;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 4.2;
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Release;
|
||||
|
@ -452,7 +454,7 @@
|
|||
SKIP_INSTALL = YES;
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Logger/Logger-Bridging-Header.h";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 4.2;
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Debug;
|
||||
|
@ -471,7 +473,7 @@
|
|||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Logger/Logger-Bridging-Header.h";
|
||||
SWIFT_VERSION = 4.2;
|
||||
SWIFT_VERSION = 5.0;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Release;
|
||||
|
|
|
@ -107,7 +107,7 @@ extension Logger {
|
|||
public func log(_ message: @autoclosure () -> String, level: LogLevel, file: String = #file, line: Int = #line, function: String = #function) {
|
||||
let now = Date()
|
||||
let location = description(for: file, line: line, function: function)
|
||||
log(time: now, level: level, location: location, message: message)
|
||||
log(time: now, level: level, location: location, message: message())
|
||||
}
|
||||
|
||||
/// Returns location in format `"<file name>:<line> <function>"`.
|
||||
|
|
|
@ -38,7 +38,7 @@ public final class AgregateLogger: Logger {
|
|||
|
||||
public func log(time: Date, level: LogLevel, location: String, message: @autoclosure () -> String) {
|
||||
for logger in self.loggers {
|
||||
logger.log(time: time, level: level, location: location, message: message)
|
||||
logger.log(time: time, level: level, location: location, message: message())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ class FileWriterTests: XCTestCase {
|
|||
func testKeepingFileSizeLimit() throws {
|
||||
let factory = FileMockFactory()
|
||||
let writer = try FileWriter(fileURL: logURL, fileSizeLimit: 1, fileFactory: factory)
|
||||
let data = Data(bytes: [0])
|
||||
let data = Data([0])
|
||||
try writer.write(data)
|
||||
|
||||
XCTAssertEqual(factory.mock.writtenData, data)
|
||||
|
@ -48,7 +48,7 @@ class FileWriterTests: XCTestCase {
|
|||
func testExceedingFileSizeLimit() throws {
|
||||
let factory = FileMockFactory()
|
||||
let writer = try FileWriter(fileURL: logURL, fileSizeLimit: 1, fileFactory: factory)
|
||||
let data = Data(bytes: [0, 0])
|
||||
let data = Data([0, 0])
|
||||
|
||||
XCTAssertThrowsError(try writer.write(data), "file size limit exceeded") { (error) in
|
||||
XCTAssertTrue(error is SizeLimitedFileQuotaReached)
|
||||
|
|
Loading…
Add table
Reference in a new issue