()
| 291 | } |
| 292 | |
| 293 | func ExampleEvent_Objects() { |
| 294 | log := zerolog.New(os.Stdout) |
| 295 | |
| 296 | // User implements zerolog.LogObjectMarshaler |
| 297 | u := User{"John", 35, time.Time{}} |
| 298 | u2 := User{"Bono", 54, time.Time{}} |
| 299 | users := []User{u, u2} |
| 300 | |
| 301 | log.Log(). |
| 302 | Objects("users", zerolog.AsLogObjectMarshalers(users)). |
| 303 | Msg("hello world") |
| 304 | // 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"} |
| 305 | } |
| 306 | |
| 307 | func ExampleEvent_ObjectsV() { |
| 308 | log := zerolog.New(os.Stdout) |
nothing calls this directly
no test coverage detected