There is a way to configure Logger for a connection (even though it may be not a modern Go way to deal with log customization):
but no way to do so for connection pool:
|
log.Printf("tarantool: connect to %s failed: %s\n", instance.Name, err) |
|
log.Printf("tarantool: connect to %s failed: %s\n", name, err) |
so if you need to customize it in any way, you need to overwrite a global logger. It would be nice to be able to pass a custom logger to a pool constructor in case one needs it. (For example, we used it for a TCF client to hide expected connection error messages.) It also may be nice to rework existing Logger interface to something build-in like log or slog interface/type.
There is a way to configure
Loggerfor a connection (even though it may be not a modern Go way to deal with log customization):go-tarantool/connection.go
Line 329 in ce667de
but no way to do so for connection pool:
go-tarantool/pool/connection_pool.go
Line 326 in ce667de
go-tarantool/pool/connection_pool.go
Line 730 in ce667de
so if you need to customize it in any way, you need to overwrite a global logger. It would be nice to be able to pass a custom logger to a pool constructor in case one needs it. (For example, we used it for a TCF client to hide expected connection error messages.) It also may be nice to rework existing
Loggerinterface to something build-in likelogorsloginterface/type.