Description
The Go SDK currently uses log.Printf for internal logging, which writes directly to stdout. This is problematic.
Component
Golang SDK 🐹
Proposed solution
(I am not a expert in logger so I believe you can come up with a better solution):
- Define a minimal logger interface:
type Logger interface {
Debug()
Info()
Error()
Warning()
....
}
- Accept it as a client option:
WithLogger(logger Logger)
- The default logger should be silent by default, but it still need to have enough feature implemented that user can use by simply modify the log level/filter, and the output stream should also be configurable.
- Replace all
log.Printf calls with c.logger.Printf, mirror the logger with rust sdk.
References
Any exellent Golang opensource project. Many of them have a logger in it :)
Description
The Go SDK currently uses
log.Printffor internal logging, which writes directly to stdout. This is problematic.Component
Golang SDK 🐹
Proposed solution
(I am not a expert in logger so I believe you can come up with a better solution):
WithLogger(logger Logger)log.Printfcalls with c.logger.Printf, mirror the logger with rust sdk.References
Any exellent Golang opensource project. Many of them have a logger in it :)