example: remove -v flag and custom logger configuration (#4242)

Users can adjust the log level using the QUIC_GO_LOG_LEVEL environment
variable. This is more representative of how quic-go would actually be
used, since the logger is part of an internal package.
This commit is contained in:
Marten Seemann
2024-01-13 16:59:58 +07:00
committed by GitHub
parent 2cd9ed38f1
commit 13327521a5
2 changed files with 5 additions and 26 deletions

View File

@@ -121,7 +121,7 @@ func setupHandler(www string) http.Handler {
err = errors.New("couldn't get uploaded file size")
}
}
utils.DefaultLogger.Infof("Error receiving upload: %#v", err)
log.Printf("Error receiving upload: %#v", err)
}
io.WriteString(w, `<html><body><form action="/demo/upload" method="post" enctype="multipart/form-data">
<input type="file" name="uploadfile"><br>
@@ -139,7 +139,6 @@ func main() {
}()
// runtime.SetBlockProfileRate(1)
verbose := flag.Bool("v", false, "verbose")
bs := binds{}
flag.Var(&bs, "bind", "bind to")
www := flag.String("www", "", "www data")
@@ -149,15 +148,6 @@ func main() {
enableQlog := flag.Bool("qlog", false, "output a qlog (in the same directory)")
flag.Parse()
logger := utils.DefaultLogger
if *verbose {
logger.SetLogLevel(utils.LogLevelDebug)
} else {
logger.SetLogLevel(utils.LogLevelInfo)
}
logger.SetLogTimeFormat("")
if len(bs) == 0 {
bs = binds{"localhost:6121"}
}