go-tarantool
go-tarantool copied to clipboard
go-tarantool/v2/pool.Add: no logs on single connection failure
Create pool with empty set of instances:
p, err := pool.ConnectWithOpts(ctx, []pool.Instance{}, connOpts)
...
Later, try to add new instances via add method:
if err = p.Add(ctx, instance); err != nil {
return fmt.Errorf("conn [%s] err: %w", instance.Name, err)
}
When unable to establish connection with tarantool, i got no err here, no message in logs.
First of all, no any logging at pool/connection_pool.go:285, if canceled
variable is false.
Second - no any err handling and logging at pool/connection_pool.go:1419.
Easy proposal: add some basic log.Printf
for logging errors in code above.
Hard proposal:
- expand basic Logger interface by basic logging methods (Info)
- remove method Report from Logger
- move method Report from defaultLogger to a specific or common dealer, which always logs specific events with Logger methods
- use Logger more often in code
This can allow:
- use custom logger inside a connector by writing specific adapter
- do not touch default log.SetOutput
- manage of verbose level
Thank you for the feedback!
This doesn't look like a priority bug or issue, so I can't promise we'll start working on it soon. But you could create a pull request with Easy proposal: add some basic log.Printf for logging errors in code above.
and we will review/merge it.
We have some ideas to improve logging for ConnectionPool
so the proposal was added to the backlog.
Alright, i`ll try to do a request with logs in described parts today. Backlog state looks good.