proxy: improve addr handling

This commit is contained in:
nadoo committed 2022-01-28 23:35:29 +08:00
1 parent e12642b47a
commit 7e7c7553cc
12 files changed
+99 -109

No files matched your search

+9 -7
View File
@@ -5,17 +5,19 @@ import (
stdlog "log"
)
// F is the main log function.
var F = func(string, ...any) {}
var verbose = false
// SetFlags sets the output flags for the logger.
func SetFlags(flag int) {
// Set sets the logger's verbose mode and output flags.
func Set(v bool, flag int) {
verbose = v
stdlog.SetFlags(flag)
}
// Debugf prints debug log.
func Debugf(f string, v ...any) {
stdlog.Output(2, fmt.Sprintf(f, v...))
// F prints debug log.
func F(f string, v ...any) {
if verbose {
stdlog.Output(2, fmt.Sprintf(f, v...))
}
}
// Print prints log.