From bead451a6cd3b21bcca928cffb76db173cd1dfca Mon Sep 17 00:00:00 2001 From: Subeom Choi Date: Fri, 19 Jan 2024 19:40:25 +0900 Subject: [PATCH] fix: solve issue that os log category and subsystem is not applied, solve issue that JSONClientTest is failed --- Source/AppleLogger/Implement/LogService.swift | 6 +----- Test/Network/JSONClientTest.swift | 6 +++--- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Source/AppleLogger/Implement/LogService.swift b/Source/AppleLogger/Implement/LogService.swift index 390a0c1..f6f02c2 100644 --- a/Source/AppleLogger/Implement/LogService.swift +++ b/Source/AppleLogger/Implement/LogService.swift @@ -19,11 +19,7 @@ public struct OSLogService: LogService { } private func sendLog(_ message: StaticString, log: OSLog, type: OSLogType, _ args: CVarArg) { - if #available(iOS 12.0, macOS 10.14, tvOS 12.0, watchOS 5.0, *) { - os_log(type, message, args) - } else { - os_log(message, log: log, type: type, args) - } + os_log(message, log: log, type: type, args) } init(_ osLog: OSLog) { diff --git a/Test/Network/JSONClientTest.swift b/Test/Network/JSONClientTest.swift index c166438..b32a46c 100644 --- a/Test/Network/JSONClientTest.swift +++ b/Test/Network/JSONClientTest.swift @@ -78,7 +78,7 @@ final class JSONClientTest: XCTestCase { Expect.promise( response, - state: .rejected(JSONClientError.responseDataIsNotDecodable), + state: .rejected(JSONClientError.responseDataIsNotDecodable(code: 200, body: Data())), timeout: .seconds(2) ) } @@ -154,7 +154,7 @@ final class JSONClientTest: XCTestCase { Expect.promise( response, - state: .rejected(JSONClientError.responseDataIsNotDecodable), + state: .rejected(JSONClientError.responseDataIsNotDecodable(code: 200, body: nil)), timeout: .seconds(2) ) } @@ -179,7 +179,7 @@ final class JSONClientTest: XCTestCase { Expect.promise( response, - state: .rejected(JSONClientError.responseDataIsNotDecodable), + state: .rejected(JSONClientError.responseDataIsNotDecodable(code: 200, body: Data())), timeout: .seconds(2) ) }