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.GpoMaxGasPriceFlag,
utils.GpoIgnoreGasPriceFlag, utils.GpoIgnoreGasPriceFlag,
configFileFlag, configFileFlag,
utils.DebugFlag, utils.LogDebugFlag,
utils.BacktraceAtFlag, utils.LogBacktraceAtFlag,
}, utils.NetworkFlags, utils.DatabaseFlags) }, utils.NetworkFlags, utils.DatabaseFlags)
rpcFlags = []cli.Flag{ rpcFlags = []cli.Flag{

View file

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

View file

@ -39,6 +39,8 @@ var DeprecatedFlags = []cli.Flag{
CacheTrieRejournalFlag, CacheTrieRejournalFlag,
LegacyDiscoveryV5Flag, LegacyDiscoveryV5Flag,
TxLookupLimitFlag, TxLookupLimitFlag,
LogBacktraceAtFlag,
LogDebugFlag,
} }
var ( var (
@ -78,16 +80,16 @@ var (
Category: flags.DeprecatedCategory, Category: flags.DeprecatedCategory,
} }
// Deprecated November 2023 // Deprecated November 2023
BacktraceAtFlag = &cli.StringFlag{ LogBacktraceAtFlag = &cli.StringFlag{
Name: "log.backtrace", 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: "", Value: "",
Category: flags.LoggingCategory, Category: flags.DeprecatedCategory,
} }
DebugFlag = &cli.BoolFlag{ LogDebugFlag = &cli.BoolFlag{
Name: "log.debug", Name: "log.debug",
Usage: "Prepends log messages with call-site location (file and line number)", Usage: "Prepends log messages with call-site location (deprecated)",
Category: flags.LoggingCategory, Category: flags.DeprecatedCategory,
} }
) )