Chore(core): use config.PrintFunc

This commit is contained in:
xjasonlyu
2022-03-31 17:48:52 +08:00
parent ccf53dcb88
commit 21232703af
4 changed files with 14 additions and 14 deletions

View File

@@ -2,6 +2,7 @@ package engine
import (
"errors"
"fmt"
"sync"
"github.com/xjasonlyu/tun2socks/v2/component/dialer"
@@ -158,8 +159,8 @@ func netstack(k *Key) (err error) {
if _defaultStack, err = core.CreateStack(&core.Config{
LinkEndpoint: _defaultDevice,
TransportHandler: &mirror.Tunnel{},
ErrorFunc: func(err tcpip.Error) {
log.Warnf("[STACK] %s", err)
PrintFunc: func(format string, v ...any) {
log.Warnf("[STACK] %s", fmt.Sprintf(format, v...))
},
}); err != nil {
return