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(logger): add prettyPrint in config #186

Merged

Conversation

benjamin-guibert
Copy link
Contributor

@benjamin-guibert benjamin-guibert commented Mar 30, 2024

Today, there is no way of customizing the way events are displayed when working locally (in development), they're systematically printed through the prettyPrint() function. It'd be nice to have a way to customize this behavior, for example by providing a custom function that would be called instead of prettyPrint().

This PR adds am optional prettyPrint function in the config object passed in the Logger constructor. If provided, this function will be called instead of the default prettyPrint() function.

Exemple:

const logger = new Logger({
  prettyPrint: (event) => {
    console.log(event.message);
  },
});

Copy link

vercel bot commented Mar 30, 2024

@benjamin-guibert is attempting to deploy a commit to the AxiomFM Team on Vercel.

A member of the Team first needs to authorize it.

@benjamin-guibert benjamin-guibert marked this pull request as ready for review March 30, 2024 12:41
@schehata schehata requested a review from c-ehrlich April 2, 2024 13:27
@schehata schehata added the enhancement New feature or request label Apr 2, 2024
@benjamin-guibert
Copy link
Contributor Author

Hello, any update? 😃

@schehata
Copy link
Collaborator

Hello, any update? 😃

hi @benjamin-guibert, sorry for the late reply, looks like I have missed your PR. Your change looks great, if you can add an example to the docs, that would be perfect. then we can merge right away.

@benjamin-guibert
Copy link
Contributor Author

Hello, any update? 😃

hi @benjamin-guibert, sorry for the late reply, looks like I have missed your PR. Your change looks great, if you can add an example to the docs, that would be perfect. then we can merge right away.

Great! It's done. 👍🏻

Copy link

vercel bot commented May 20, 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 May 20, 2024 9:10am

@schehata schehata merged commit bdc5366 into axiomhq:main May 20, 2024
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants