Namespace creates a named, isolated scope within the logger's context. All subsequent fields will be added to the new namespace. This helps prevent key collisions when injecting loggers into sub-components or third-party libraries.
(key string)
| 333 | // This helps prevent key collisions when injecting loggers into sub-components |
| 334 | // or third-party libraries. |
| 335 | func Namespace(key string) Field { |
| 336 | return Field{Key: key, Type: zapcore.NamespaceType} |
| 337 | } |
| 338 | |
| 339 | // Stringer constructs a field with the given key and the output of the value's |
| 340 | // String method. The Stringer's String method is called lazily. |
no outgoing calls