small debugging tweak, add email to license

This commit is contained in:
kayos@tcp.direct 2022-11-22 21:25:24 -08:00
parent 6c46af05f3
commit d9075f2979
Signed by: kayos
GPG Key ID: 4B841471B4BEE979
2 changed files with 11 additions and 10 deletions

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2021 yung innanet
Copyright (c) 2021 yung innanet (kayos@tcp.direct)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -21,6 +21,8 @@ func init() {
const (
debugEnabled uint32 = iota
debugDisabled
stamp = "[prox5] "
)
type SocksLogger struct {
@ -37,20 +39,19 @@ func (s SocksLogger) Printf(format string, a ...interface{}) {
type basicPrinter struct{}
func (b *basicPrinter) Print(str string) {
if !useDebugChannel {
println("[prox5] " + str)
} else {
if useDebugChannel {
debugChan <- str
return
}
buf := strs.Get()
buf.MustWriteString(stamp)
buf.MustWriteString(str)
println(buf.String())
strs.MustPut(buf)
}
func (b *basicPrinter) Printf(format string, items ...any) {
str := fmt.Sprintf("[prox5] "+format, items)
if !useDebugChannel {
println(str)
} else {
debugChan <- str
}
b.Print(fmt.Sprintf(format, items...))
}
func (b *basicPrinter) Errorf(format string, items ...any) {