Pass ctx to transporter#83
Open
roark wants to merge 1 commit into
Open
Conversation
|
When does it ship? |
|
Anyone who waiting for this feature may do this temporarily: import koaLogger from "koa-logger";
app.use(async (ctx, next) => {
const koaLoggerInstance = koaLogger(logString => {
// Do anything with ctx
});
await koaLoggerInstance(ctx, next);
}); |
Doing this instantiates a brand new instance of koa-logger for every request. This might not be a problem for your use case, but could have memory & performance implications in high-throughput scenarios. |
This was
linked to
issues
Jun 12, 2025
Member
|
Thanks @roark for your contribution, could you please add test cases here! |
|
@3imed-jaberi could it be merged? It is a very useful improvement! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enables more verbose Transporter to log other ctx details. Fixes issues #77 and #82.
ctxis passed as the 3rd argument to transporter as to not disrupt any existing code. That said, it could easily be the first argument if desired.