cmd, debug: fix debug_verbosity (#1030)

This commit is contained in:
Daniel Liu 2025-05-08 16:10:53 +08:00 committed by GitHub
parent c70186be18
commit fbd4364fc3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 3 deletions

View file

@ -43,7 +43,7 @@ func main() {
natdesc = flag.String("nat", "none", "port mapping mechanism (any|none|upnp|pmp|extip:<IP>)")
netrestrict = flag.String("netrestrict", "", "restrict network communication to the given IP networks (CIDR masks)")
runv5 = flag.Bool("v5", false, "run a v5 topic discovery bootnode")
verbosity = flag.Int("verbosity", int(log.LvlInfo), "log verbosity (0-9)")
verbosity = flag.Int("verbosity", 3, "log verbosity (0-5)")
vmodule = flag.String("vmodule", "", "log verbosity pattern")
nodeKey *ecdsa.PrivateKey

View file

@ -23,7 +23,6 @@ package debug
import (
"errors"
"io"
"log/slog"
"os"
"os/user"
"path/filepath"
@ -56,7 +55,7 @@ type HandlerT struct {
// Verbosity sets the log verbosity ceiling. The verbosity of individual packages
// and source files can be raised using Vmodule.
func (*HandlerT) Verbosity(level int) {
glogger.Verbosity(slog.Level(level))
glogger.Verbosity(log.FromLegacyLevel(level))
}
// Vmodule sets the log verbosity pattern. See package log for details on the