Skip to content
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: Add logRequestDetails option to withAxiomRouteHandler #243

Merged
merged 9 commits into from
Nov 22, 2024

Conversation

gabrielelpidio
Copy link
Collaborator

@gabrielelpidio gabrielelpidio commented Nov 12, 2024

This PR introduces an optional configuration object that contains a logRequestDetails property to specify if and whether to include detailed request information.

Example of usage

export const GET = withAxiomRouteHandler(
  async () => {
    return new Response("Hello World!");
  },
  { logRequestDetails: true }
);

or

export const GET = withAxiomRouteHandler(
  async () => {
    return new Response("Hello World!");
  },
  { logRequestDetails: ['body', 'nextUrl'] }
);

Copy link

vercel bot commented Nov 12, 2024

@gabrielelpidio is attempting to deploy a commit to the AxiomFM Team on Vercel.

A member of the Team first needs to authorize it.

@gabrielelpidio gabrielelpidio marked this pull request as draft November 12, 2024 17:48
@gabrielelpidio gabrielelpidio marked this pull request as ready for review November 12, 2024 19:21
Copy link

vercel bot commented Nov 12, 2024

Deployment failed with the following error:

The provided GitHub repository does not contain the requested branch or commit reference. Please ensure the repository is not empty.

Copy link

vercel bot commented Nov 13, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
next-axiom-example ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 21, 2024 5:25pm

Copy link
Contributor

@c-ehrlich c-ehrlich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good. Some small docs suggestions included.

Significant topic: I am not sure details is the best name for this api. Won't block on that, but maybe ask someone else for their opinion on this. I would suggest something along the lines of include(Req|Request), log(Req|Request) but not 100% on those suggestions either.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@gabrielelpidio gabrielelpidio changed the title feat: Add details option to withAxiomRouteHandler feat: Add logReq option to withAxiomRouteHandler Nov 18, 2024
@gabrielelpidio gabrielelpidio changed the title feat: Add logReq option to withAxiomRouteHandler feat: Add logRequestDetails option to withAxiomRouteHandler Nov 21, 2024
@c-ehrlich c-ehrlich merged commit f068f0d into axiomhq:main Nov 22, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants