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

custom logger #3

Merged
merged 6 commits into from
Jun 1, 2024
Merged

custom logger #3

merged 6 commits into from
Jun 1, 2024

Conversation

Pfeifenjoy
Copy link
Contributor

Allow users to pass a custom logging function for warnings.

@alexmarqs
Copy link
Owner

Thanks for submitting your PR, I will have a look later today! 🙏

@alexmarqs
Copy link
Owner

Hi @Pfeifenjoy just added small changes to your PR:

  • upgraded biome (as you changed something related + I noticed that the npm script lint and format were not using the dev dependency biome version)
  • Added unit tests
  • Small refactor like moving types to central place

Let me know if it fits your purpose and then I can approve and merge it! tks!

@Pfeifenjoy
Copy link
Contributor Author

Pfeifenjoy commented May 28, 2024

Hi @alexmarqs

sounds cool, I am of course good with it. Yeah the build was fucking me up a bit, was not sure if you wanted to stay with pnpm.
Actually I tried this out in an application I am building now and noticed that it actually is not the right idea.
Usually someone would configure the log level in the config, which is after the adapter is executed.

I am thinking about changing this a bit because my intention was to have the adapters fail silently. That can also be done by leaving the warn log function empty but I am not sure if that is a good approach or if it is better to add the option "silent" to the adapters. Let me know of your opinion.

@alexmarqs
Copy link
Owner

Hi @Pfeifenjoy , actually why not both 🤔 ? Last night drafted something about your suggestion, see PR changes.(introduced a silentFail for the adapters, maybe we could also have a generic/config level that would apply this setting for all adapters, but I think having it per adapter should be fine for now).

Cheers, let me know your feedback!

@alexmarqs
Copy link
Owner

I will merge this later today as I think it introduces some small cool features to next release, thanks for the contribution. In the meantime let me know if this fits your use case or if you would like to see any other! If so, feel free to open a new issue or reach me out. Thanks.

@alexmarqs alexmarqs merged commit 076f968 into alexmarqs:main Jun 1, 2024
3 checks passed
@alexmarqs
Copy link
Owner

Released here. As usual, feel free to share any other suggestions or requests in a new issue. tks!

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