RegisterLoggerBuilder registers the builder in a global map using b.Name() as the key. This should only be called during initialization time (i.e. in an init() function). If multiple builders are registered with the same name, the one registered last will take effect.
(b LoggerBuilder)
| 44 | // function). If multiple builders are registered with the same name, |
| 45 | // the one registered last will take effect. |
| 46 | func RegisterLoggerBuilder(b LoggerBuilder) { |
| 47 | registry.mu.Lock() |
| 48 | defer registry.mu.Unlock() |
| 49 | registry.builders[b.Name()] = b |
| 50 | } |
| 51 | |
| 52 | // GetLoggerBuilder returns a builder with the given name. |
| 53 | // It returns nil if the builder is not found in the registry. |