WithOptions clones the current Logger, applies the supplied Options, and returns the resulting Logger. It's safe to use concurrently.
(opts ...Option)
| 167 | // WithOptions clones the current Logger, applies the supplied Options, and |
| 168 | // returns the resulting Logger. It's safe to use concurrently. |
| 169 | func (log *Logger) WithOptions(opts ...Option) *Logger { |
| 170 | c := log.clone() |
| 171 | for _, opt := range opts { |
| 172 | opt.apply(c) |
| 173 | } |
| 174 | return c |
| 175 | } |
| 176 | |
| 177 | // With creates a child logger and adds structured context to it. Fields added |
| 178 | // to the child don't affect the parent, and vice versa. Any fields that |