Alternative Logger option#12289
Conversation
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
| Resource pcommon.Resource | ||
| } | ||
|
|
||
| func (ts *TelemetrySettings) LoggerWithout(fields ...string) *zap.Logger { |
There was a problem hiding this comment.
Adding this method does make usage cleaner for component authors, which is very nice.
That said, I think it is necessary to expose the interface in this package as well in order to allow reasonable type assertions elsewhere, such as testing the actual implementation of the logger.
There was a problem hiding this comment.
That said, I think it is necessary to expose the interface in this package as well in order to allow reasonable type assertions elsewhere, such as testing the actual implementation of the logger.
Not sure about that, you can have the interface in other place if needed. Example in golang "errors", the Unwrap is not an interface, see
https://cs.opensource.google/go/go/+/refs/tags/go1.23.5:src/errors/wrap.go;l=17
I do believe that if we don't expose an interface, we need to have this as "optional", meaning we need to check if it implements what we want to implement, otherwise return the same logger probably...
|
This POC achieved its target. Closing. |
No description provided.