mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 20:04:02 +03:00
Intergrate custom logger where applicable
This commit is contained in:
+1
-5
@@ -87,10 +87,6 @@ func (p *Proxy) Shutdown() {
|
||||
p.workerPool.Release()
|
||||
}
|
||||
|
||||
type antsLogger struct{}
|
||||
|
||||
func (a antsLogger) Printf(msg string, args ...interface{}) {}
|
||||
|
||||
func NewProxy(opts ProxyOpts) (*Proxy, error) {
|
||||
switch {
|
||||
case opts.Network == nil:
|
||||
@@ -126,7 +122,7 @@ func NewProxy(opts ProxyOpts) (*Proxy, error) {
|
||||
|
||||
pool, err := ants.NewPoolWithFunc(int(concurrency), func(arg interface{}) {
|
||||
proxy.ServeConn(arg.(net.Conn))
|
||||
}, ants.WithLogger(antsLogger{}))
|
||||
}, ants.WithLogger(opts.Logger.Named("ants")))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot initialize a pool: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user