Skip to content

Commit

Permalink
chore: Update to aws-crt-swift 0.36.0 (#822)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbelkins authored Sep 13, 2024
1 parent 5a07437 commit a557819
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ let package = Package(
.library(name: "SmithyTestUtil", targets: ["SmithyTestUtil"]),
],
dependencies: [
.package(url: "https://github.com/awslabs/aws-crt-swift.git", exact: "0.33.0"),
.package(url: "https://github.com/awslabs/aws-crt-swift.git", exact: "0.36.0"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"),
],
targets: [
Expand Down
15 changes: 13 additions & 2 deletions Sources/ClientRuntime/Networking/Http/CRT/SDKDefaultIO.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ public final class SDKDefaultIO: @unchecked Sendable {
/// If any log level other than the default log level of `.none` is desired,
/// this setter needs to be called as the first thing in the program.
public func setLogLevel(level: LogLevel) {
Logger.initialize(pipe: stdout, level: level)
Self.setupLogger(level: level)
}

private init() {
CommonRuntimeKit.initialize()
Logger.initialize(pipe: stdout, level: .none)
Self.setupLogger(level: .none)

do {
self.eventLoopGroup = try EventLoopGroup(threadCount: 0)
Expand Down Expand Up @@ -79,4 +79,15 @@ public final class SDKDefaultIO: @unchecked Sendable {
""")
}
}

private static func setupLogger(level: LogLevel) {
do {
try Logger.initialize(target: .standardOutput, level: level)
} catch {
fatalError("""
Logger failed to create. This should never happen. Please open a
Github issue with us at https://github.com/awslabs/aws-sdk-swift.
""")
}
}
}

0 comments on commit a557819

Please sign in to comment.