()
| 24 | } |
| 25 | |
| 26 | func ExampleWithFields() { |
| 27 | ctx := context.Background() |
| 28 | ctx = WithFields(ctx, logrus.Fields{ |
| 29 | "foo": "bar", |
| 30 | }) |
| 31 | |
| 32 | log := New("testing") |
| 33 | |
| 34 | // Typically called as log(ctx, nil).Debug("the message") |
| 35 | entry := log(ctx, nil) |
| 36 | fmt.Printf("%+v", entry.Data["foo"]) |
| 37 | |
| 38 | // Output: |
| 39 | // bar |
| 40 | } |
| 41 | |
| 42 | type exampleLoggable logrus.Fields |
| 43 |
nothing calls this directly
no test coverage detected