diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 5e9a8fc5..09b17cdf 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -47,12 +47,12 @@ jobs: # https://github.com/swiftlang/github-workflows/issues/34 musl: runs-on: ubuntu-latest - container: swift:6.0-noble + container: swift:6.0.2-noble timeout-minutes: 30 steps: - name: Check out code uses: actions/checkout@v4 - name: Install SDK - run: swift sdk install https://download.swift.org/swift-6.0.1-release/static-sdk/swift-6.0.1-RELEASE/swift-6.0.1-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz --checksum d4f46ba40e11e697387468e18987ee622908bc350310d8af54eb5e17c2ff5481 + run: swift sdk install https://download.swift.org/swift-6.0.2-release/static-sdk/swift-6.0.2-RELEASE/swift-6.0.2-RELEASE_static-linux-0.0.1.artifactbundle.tar.gz --checksum aa5515476a403797223fc2aad4ca0c3bf83995d5427fb297cab1d93c68cee075 - name: Build run: swift build --swift-sdk x86_64-swift-linux-musl diff --git a/Sources/AWSLambdaRuntimeCore/LambdaRuntime.swift b/Sources/AWSLambdaRuntimeCore/LambdaRuntime.swift index 908e2ab2..726c39a4 100644 --- a/Sources/AWSLambdaRuntimeCore/LambdaRuntime.swift +++ b/Sources/AWSLambdaRuntimeCore/LambdaRuntime.swift @@ -33,6 +33,12 @@ public final class LambdaRuntime: @unchecked Sendable where Handler: St ) { self.handlerMutex = NIOLockedValueBox(handler) self.eventLoop = eventLoop + + // by setting the log level here, we understand it can not be changed dynamically at runtime + // developers have to wait for AWS Lambda to dispose and recreate a runtime environment to pickup a change + // this approach is less flexible but more performant than reading the value of the environment variable at each invocation + var log = logger + log.logLevel = Lambda.env("LOG_LEVEL").flatMap(Logger.Level.init) ?? .info self.logger = logger }