Use pointer for debug logger

This commit is contained in:
kayos@tcp.direct 2022-08-31 11:38:44 -07:00
parent d5a53a44ff
commit 672835a9e1
Signed by: kayos
GPG Key ID: 4B841471B4BEE979
2 changed files with 3 additions and 3 deletions

@ -37,11 +37,11 @@ func (s SocksLogger) Printf(format string, a ...interface{}) {
type basicPrinter struct{} type basicPrinter struct{}
func (b basicPrinter) Print(str string) { func (b *basicPrinter) Print(str string) {
println("[prox5] " + str) println("[prox5] " + str)
} }
func (b basicPrinter) Printf(format string, items ...any) { func (b *basicPrinter) Printf(format string, items ...any) {
println(fmt.Sprintf("prox5: "+format, items)) println(fmt.Sprintf("prox5: "+format, items))
} }

@ -140,7 +140,7 @@ type config struct {
func NewProxyEngine() *ProxyEngine { func NewProxyEngine() *ProxyEngine {
pe := &ProxyEngine{ pe := &ProxyEngine{
stats: &statistics{birthday: time.Now()}, stats: &statistics{birthday: time.Now()},
DebugLogger: basicPrinter{}, DebugLogger: &basicPrinter{},
swampopt: defOpt(), swampopt: defOpt(),