Skip to content

Commit

Permalink
fix: solve issue that os log category and subsystem is not applied, s…
Browse files Browse the repository at this point in the history
…olve issue that JSONClientTest is failed
  • Loading branch information
0xWOF committed Jan 19, 2024
1 parent eeecf6b commit bead451
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 1 addition & 5 deletions Source/AppleLogger/Implement/LogService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions Test/Network/JSONClientTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
}
Expand Down Expand Up @@ -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)
)
}
Expand All @@ -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)
)
}
Expand Down

0 comments on commit bead451

Please sign in to comment.