-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aws-cdk-lib/aws-lambda-nodejs: add VERBOSE log level to esbuild bundling #27634
Comments
@dreamorosi I'm taking a look at this. To me, the |
Hi @msambol thanks for looking into this & for the response. I actually didn't notice that the same enum was used elsewhere, including package managers. The usage that I was referring to is at this line: ...this.props.logLevel ? [`--log-level=${this.props.logLevel}`] : [], This is part of the I'm not sure whether adding a |
@peterwoodworth Could you weigh in for the CDK team here? Do we want to define separate enums for each package manager? I could see [1]
[2]
|
Since npm does have a verbose log level (see docs here), and the other two don't use it at all, I think we could already add the |
This should be an option, you're right! I could easily see the enum having all these levels but a helper function that "clamps" it at a maximum level (since one tool doesn't know I've added this to our weekly review session. |
Let me know the result of the discussion, I'd be happy to implement. |
@indrora / @dreamorosi I created #27657 to track the enhancement. I will also add |
…ing (#27658) Official log levels are [here](https://esbuild.github.io/api/#log-level). Closes #27634. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Describe the feature
The
NodejsFunction
constructs allows customers to bundle code usingesbuild
. The construct already has abundling.logLevel
property that allows to set the log level for theesbuild
CLI.Currently CDK exposes only some of the log levels (i.e.
INFO
,ERROR
,WARNING
, andSILENT
), howeveresbuild
offers more, namelyVERBOSE
.I propose to add the
VERBOSE
log level to the existing ones, so that CDK customers can use it to troubleshoot or inspect issues with the bundling process.Use Case
When bundling functions sometimes it's useful to see the full log output, this is especially helpful when debugging module resolution issues and to understand how a certain module ends up (or doesn't) in the final bundle.
For example, when enabled, the verbose output gives info similar to this (for each module resolved):
Proposed Solution
Add the extra log levels to the , which is defined here.
The change would look like this:
Other Information
No response
Acknowledgements
CDK version used
2.102.0
Environment details (OS name and version, etc.)
macOS
The text was updated successfully, but these errors were encountered: