mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
use log package JSONHandler wrapper
This commit is contained in:
parent
bd684ceac7
commit
dad6ef06fe
2 changed files with 3 additions and 3 deletions
|
|
@ -234,9 +234,9 @@ func Setup(ctx *cli.Context) error {
|
|||
case ctx.Bool(logjsonFlag.Name):
|
||||
// Retain backwards compatibility with `--log.json` flag if `--log.format` not set
|
||||
defer log.Warn("The flag '--log.json' is deprecated, please use '--log.format=json' instead")
|
||||
handler = slog.NewJSONHandler(output, nil)
|
||||
handler = log.JSONHandler(output)
|
||||
case logFmtFlag == "json":
|
||||
handler = slog.NewJSONHandler(output, nil)
|
||||
handler = log.JSONHandler(output)
|
||||
case logFmtFlag == "logfmt":
|
||||
handler = log.LogfmtHandler(output)
|
||||
case logFmtFlag == "", logFmtFlag == "terminal":
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ func (l *leveler) Level() slog.Level {
|
|||
return l.minLevel
|
||||
}
|
||||
|
||||
func JsonHandler(wr io.Writer) slog.Handler {
|
||||
func JSONHandler(wr io.Writer) slog.Handler {
|
||||
return slog.NewJSONHandler(wr, &slog.HandlerOptions{
|
||||
ReplaceAttr: builtinReplace,
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue