-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
feat: adds logLevel option, so users can debug lambda functions #286
Conversation
WalkthroughThe recent update integrates a logging mechanism across the system, introducing a Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (4)
- lambda/index.ts (2 hunks)
- lambda/types.ts (2 hunks)
- lib/index.ts (3 hunks)
- test/lib/test-stack.ts (3 hunks)
Additional comments: 11
lambda/types.ts (2)
- 4-11: The
LogLevel
enum is well-defined and follows common conventions for logging levels. Good use of ESLint directives to handle naming conventions.- 34-34: Adding the optional
LogLevel
field to theResourceProperties
interface is a sensible choice, allowing users to specify their desired logging level if needed.test/lib/test-stack.ts (3)
- 11-11: The import of the
LogLevel
enum is correctly done, ensuring its availability for use within theTestStack
class.- 18-18: Defining the
logLevel
constant withLogLevel.DEBUG
is appropriate for testing purposes, as it provides detailed logging information.- 52-52: The usage of the
logLevel
constant in the configuration objects forKeyPair
instantiation is correctly implemented, ensuring that the desired logging level is applied.Also applies to: 82-82
lib/index.ts (3)
- 19-20: The import and re-export of the
LogLevel
enum are correctly done, making it available both within the module and to external consumers.- 144-149: Adding the
logLevel
property to theKeyPairProps
interface with a default value ofLogLevel.warn
is a sensible choice, ensuring backward compatibility and providing a balanced default logging level.- 259-259: Including the
logLevel
property in thelambdaProperties
object for theCustomResource
instantiation is correctly implemented, ensuring that the specified logging level is applied.lambda/index.ts (3)
- 44-46: The introduction and use of the
StandardLogger
to dynamically set the logger's level based on theLogLevel
provided by the user is correctly implemented. The handling of enum capitalization differences is also appropriately addressed.Also applies to: 66-73
- 69-70: The casting approach to handle the mapping between different enum capitalizations for
LogLevel
is a practical solution to ensure compatibility. While not ideal, it addresses the issue effectively.- 58-58: The setting of the logger's level in the
handler
function based on theLogLevel
provided inevent.ResourceProperties
is correctly implemented, ensuring that the user-specified logging level is applied as intended.Also applies to: 66-73
No description provided.