cmd/utils: make deprecated logflags properly deprecated

This commit is contained in:
Martin Holst Swende 2023-11-08 16:24:42 +01:00 committed by Jared Wasinger
parent 46b65e228b
commit fe625b8b68
3 changed files with 12 additions and 10 deletions

View file

@ -144,8 +144,8 @@ var (
utils.GpoMaxGasPriceFlag,
utils.GpoIgnoreGasPriceFlag,
configFileFlag,
utils.DebugFlag,
utils.BacktraceAtFlag,
utils.LogDebugFlag,
utils.LogBacktraceAtFlag,
}, utils.NetworkFlags, utils.DatabaseFlags)
rpcFlags = []cli.Flag{

View file

@ -1460,10 +1460,10 @@ func SetNodeConfig(ctx *cli.Context, cfg *node.Config) {
cfg.DBEngine = dbEngine
}
// deprecation notice for log debug flags (TODO: find a more appropriate place to put these?)
if ctx.IsSet(BacktraceAtFlag.Name) {
if ctx.IsSet(LogBacktraceAtFlag.Name) {
log.Warn("log.backtrace flag is deprecated")
}
if ctx.IsSet(DebugFlag.Name) {
if ctx.IsSet(LogDebugFlag.Name) {
log.Warn("log.debug flag is deprecated")
}
}

View file

@ -39,6 +39,8 @@ var DeprecatedFlags = []cli.Flag{
CacheTrieRejournalFlag,
LegacyDiscoveryV5Flag,
TxLookupLimitFlag,
LogBacktraceAtFlag,
LogDebugFlag,
}
var (
@ -78,16 +80,16 @@ var (
Category: flags.DeprecatedCategory,
}
// Deprecated November 2023
BacktraceAtFlag = &cli.StringFlag{
LogBacktraceAtFlag = &cli.StringFlag{
Name: "log.backtrace",
Usage: "Request a stack trace at a specific logging statement (e.g. \"block.go:271\")",
Usage: "Request a stack trace at a specific logging statement (deprecated)",
Value: "",
Category: flags.LoggingCategory,
Category: flags.DeprecatedCategory,
}
DebugFlag = &cli.BoolFlag{
LogDebugFlag = &cli.BoolFlag{
Name: "log.debug",
Usage: "Prepends log messages with call-site location (file and line number)",
Category: flags.LoggingCategory,
Usage: "Prepends log messages with call-site location (deprecated)",
Category: flags.DeprecatedCategory,
}
)