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 serializer #521

Closed

Conversation

sripathivenky
Copy link

  • adding serializer that allows users to pass a method to work in hand with serialize flag.

@sripathivenky
Copy link
Author

@Delgan

@Delgan
Copy link
Owner

Delgan commented Dec 5, 2021

Hi @sripathivenky.

Sorry for being late to answer and thanks for taking of your time to improve Loguru.

The idea to add a new serializer parameter has been discussed several times (#372 (comment), #339 (comment), #278 (comment), #203 (comment)). I'm reticent to do so because I'm not fan of such optional parameter while there already exists solutions which provide the same result: Serializing log messages using a custom function.

Using a custom sink, formatter or even patch() allow anyone to customize the serialization without much efforts.

I understand that a serializer option would make it more straightforward but it also adds some complexity I prefer to avoid.

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.

None yet

2 participants