mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
remove space. add back log.debug, log.backtrace flags with deprecation notice if they are set
This commit is contained in:
parent
db47dabe5e
commit
5e3efddbb0
2 changed files with 20 additions and 2 deletions
|
|
@ -40,7 +40,6 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"golang.org/x/exp/slog"
|
"golang.org/x/exp/slog"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/accounts"
|
"github.com/ethereum/go-ethereum/accounts"
|
||||||
"github.com/ethereum/go-ethereum/accounts/keystore"
|
"github.com/ethereum/go-ethereum/accounts/keystore"
|
||||||
"github.com/ethereum/go-ethereum/cmd/utils"
|
"github.com/ethereum/go-ethereum/cmd/utils"
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,6 @@ import (
|
||||||
"github.com/mattn/go-isatty"
|
"github.com/mattn/go-isatty"
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
"gopkg.in/natefinch/lumberjack.v2"
|
"gopkg.in/natefinch/lumberjack.v2"
|
||||||
|
|
||||||
"golang.org/x/exp/slog"
|
"golang.org/x/exp/slog"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -77,6 +76,17 @@ var (
|
||||||
Usage: "Write logs to a file",
|
Usage: "Write logs to a file",
|
||||||
Category: flags.LoggingCategory,
|
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{
|
logRotateFlag = &cli.BoolFlag{
|
||||||
Name: "log.rotate",
|
Name: "log.rotate",
|
||||||
Usage: "Enables log file rotation",
|
Usage: "Enables log file rotation",
|
||||||
|
|
@ -150,6 +160,8 @@ var (
|
||||||
var Flags = []cli.Flag{
|
var Flags = []cli.Flag{
|
||||||
verbosityFlag,
|
verbosityFlag,
|
||||||
logVmoduleFlag,
|
logVmoduleFlag,
|
||||||
|
backtraceAtFlag,
|
||||||
|
debugFlag,
|
||||||
vmoduleFlag,
|
vmoduleFlag,
|
||||||
logjsonFlag,
|
logjsonFlag,
|
||||||
logFormatFlag,
|
logFormatFlag,
|
||||||
|
|
@ -271,6 +283,13 @@ func Setup(ctx *cli.Context) error {
|
||||||
}
|
}
|
||||||
glogger.Vmodule(vmodule)
|
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))
|
log.SetDefault(log.NewLogger(glogger))
|
||||||
|
|
||||||
// profiling, tracing
|
// profiling, tracing
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue