zerolog
zerolog copied to clipboard
Add my own Field types?
Is it possible to add Field types for my own objects?
It is not a feature supported out of the box (i.e. without forking the package). However, you can write a String() method for your custom struct to ("relatively" quickly) parse your object into a string and then store it as such. Or you can marshal it into []bytes and store it as RawJSON, which also is supported by ZeroLog.