Use pointer for debug logger
This commit is contained in:
parent
d5a53a44ff
commit
672835a9e1
4
debug.go
4
debug.go
@ -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))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
defs.go
2
defs.go
@ -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(),
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user