zerolog icon indicating copy to clipboard operation
zerolog copied to clipboard

Add my own Field types?

Open orai-arturo opened this issue 6 years ago • 1 comments

Is it possible to add Field types for my own objects?

orai-arturo avatar Mar 29 '19 18:03 orai-arturo

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.

momilo avatar Feb 03 '20 16:02 momilo