diff --git a/cmd/faucet/faucet.go b/cmd/faucet/faucet.go index a78a58abab..f9e3ad06d7 100644 --- a/cmd/faucet/faucet.go +++ b/cmd/faucet/faucet.go @@ -40,7 +40,6 @@ import ( "time" "golang.org/x/exp/slog" - "github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/accounts/keystore" "github.com/ethereum/go-ethereum/cmd/utils" diff --git a/internal/debug/flags.go b/internal/debug/flags.go index 275ff6d405..063743f2bd 100644 --- a/internal/debug/flags.go +++ b/internal/debug/flags.go @@ -35,7 +35,6 @@ import ( "github.com/mattn/go-isatty" "github.com/urfave/cli/v2" "gopkg.in/natefinch/lumberjack.v2" - "golang.org/x/exp/slog" ) @@ -77,6 +76,17 @@ var ( Usage: "Write logs to a file", Category: flags.LoggingCategory, } + backtraceAtFlag = &cli.StringFlag{ + Name: "log.backtrace", + Usage: "Request a stack trace at a specific logging statement (e.g. \"block.go:271\")", + Value: "", + Category: flags.LoggingCategory, + } + debugFlag = &cli.BoolFlag{ + Name: "log.debug", + Usage: "Prepends log messages with call-site location (file and line number)", + Category: flags.LoggingCategory, + } logRotateFlag = &cli.BoolFlag{ Name: "log.rotate", Usage: "Enables log file rotation", @@ -150,6 +160,8 @@ var ( var Flags = []cli.Flag{ verbosityFlag, logVmoduleFlag, + backtraceAtFlag, + debugFlag, vmoduleFlag, logjsonFlag, logFormatFlag, @@ -271,6 +283,13 @@ func Setup(ctx *cli.Context) error { } glogger.Vmodule(vmodule) + if ctx.IsSet(backtraceAtFlag.Name) { + defer log.Warn("The flag '--log.backtraceat' is depcrecated and should no longer be used.") + } + if ctx.IsSet(debugFlag.Name) { + defer log.Warn("The flag '--log.debug' is depcrecated and should no longer be used.") + } + log.SetDefault(log.NewLogger(glogger)) // profiling, tracing