loguru
loguru copied to clipboard
Custom serializer
- adding serializer that allows users to pass a method to work in hand with serialize flag.
@Delgan
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 (https://github.com/Delgan/loguru/issues/372#issuecomment-736774742, https://github.com/Delgan/loguru/issues/339#issuecomment-702013972, https://github.com/Delgan/loguru/issues/278#issuecomment-639519441, https://github.com/Delgan/loguru/issues/203#issuecomment-575684228). 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.