Skip to content

Commit 448b441

Browse files
authored
chore(lambda): match enum value to property (#30472)
Looks like we are comparing `LogFormat` to the `LoggingFormat` enum. This is not technically a problem for us because `LogFormat` is a string. We deprecated it and created `LoggingFormat` to enforce the enum. This conditional works because all the enums collapse to strings, but it is best if we sync up the properties with their correct enums. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent a05591d commit 448b441

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/aws-cdk-lib/aws-lambda/lib/function.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1179,7 +1179,7 @@ export class Function extends FunctionBase {
11791179
}
11801180

11811181
if (props.applicationLogLevel || props.applicationLogLevelV2 || props.systemLogLevel || props.systemLogLevelV2) {
1182-
if (props.logFormat !== LoggingFormat.JSON && props.loggingFormat === undefined) {
1182+
if (props.logFormat !== LogFormat.JSON && props.loggingFormat === undefined) {
11831183
throw new Error(`To use ApplicationLogLevel and/or SystemLogLevel you must set LogFormat to '${LogFormat.JSON}', got '${props.logFormat}'.`);
11841184
}
11851185

0 commit comments

Comments
 (0)