-
Notifications
You must be signed in to change notification settings - Fork 162
feat(logger): JSDOCS support #491
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
Changes from 5 commits
313be43
06dc021
57c5929
acc172a
85ef8e6
4e3a532
10e07d7
9e3452d
c95159f
81096ca
61e1053
637759b
c0aeb36
1472f71
6312d2f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,13 @@ | ||
import type { Logger } from '../Logger'; | ||
import middy from '@middy/core'; | ||
|
||
/** | ||
* Middy middleware that adds the current Lambda invocation's context | ||
* inside all log items. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. an example can be useful here , and can will be more in line with what we have in tracer for instance: https://github.com/awslabs/aws-lambda-powertools-typescript/blob/main/packages/tracing/src/middleware/middy.ts#L15 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree, well spotted! |
||
* | ||
* @param {Logger|Logger[]} target | ||
* @returns middy.MiddlewareObj | ||
*/ | ||
const injectLambdaContext = (target: Logger | Logger[]): middy.MiddlewareObj => { | ||
const injectLambdaContextBefore = async (request: middy.Request): Promise<void> => { | ||
const loggers = target instanceof Array ? target : [target]; | ||
|
Uh oh!
There was an error while loading. Please reload this page.