| 305 | } |
| 306 | |
| 307 | func ExampleEvent_ObjectsV() { |
| 308 | log := zerolog.New(os.Stdout) |
| 309 | |
| 310 | // User implements zerolog.LogObjectMarshaler |
| 311 | u := User{"John", 35, time.Time{}} |
| 312 | u2 := User{"Bono", 54, time.Time{}} |
| 313 | |
| 314 | log.Log(). |
| 315 | ObjectsV("users", u, u2). |
| 316 | Msg("hello world") |
| 317 | |
| 318 | // Output: {"users":[{"name":"John","age":35,"created":"0001-01-01T00:00:00Z"},{"name":"Bono","age":54,"created":"0001-01-01T00:00:00Z"}],"message":"hello world"} |
| 319 | } |
| 320 | |
| 321 | func ExampleEvent_EmbedObject() { |
| 322 | log := zerolog.New(os.Stdout) |