Signed-off-by: hidewrong <hidewrong@outlook.com> (#14792)

Signed-off-by: hidewrong <hidewrong@outlook.com>
This commit is contained in:
hidewrong
2025-01-17 23:59:29 +08:00
committed by GitHub
parent b76f7fed2f
commit 15df13c7e6
5 changed files with 8 additions and 4 deletions

View File

@@ -0,0 +1,2 @@
### Changed
- Refactor `2006-01-02 15:04:05` to `time.DateTime`

View File

@@ -7,6 +7,7 @@ import (
"os"
"path/filepath"
runtimeDebug "runtime/debug"
"time"
gethlog "github.com/ethereum/go-ethereum/log"
golog "github.com/ipfs/go-log/v2"
@@ -163,7 +164,7 @@ func before(ctx *cli.Context) error {
switch format {
case "text":
formatter := new(prefixed.TextFormatter)
formatter.TimestampFormat = "2006-01-02 15:04:05"
formatter.TimestampFormat = time.DateTime
formatter.FullTimestamp = true
// If persistent log files are written - we disable the log messages coloring because

View File

@@ -60,7 +60,7 @@ func main() {
switch format {
case "text":
formatter := new(prefixed.TextFormatter)
formatter.TimestampFormat = "2006-01-02 15:04:05"
formatter.TimestampFormat = time.DateTime
formatter.FullTimestamp = true
// If persistent log files are written - we disable the log messages coloring because
// the colors are ANSI codes and seen as gibberish in the log files.

View File

@@ -8,6 +8,7 @@ import (
"os"
"path/filepath"
runtimeDebug "runtime/debug"
"time"
joonix "github.com/joonix/log"
"github.com/pkg/errors"
@@ -153,7 +154,7 @@ func main() {
switch format {
case "text":
formatter := new(prefixed.TextFormatter)
formatter.TimestampFormat = "2006-01-02 15:04:05"
formatter.TimestampFormat = time.DateTime
formatter.FullTimestamp = true
// If persistent log files are written - we disable the log messages coloring because
// the colors are ANSI codes and seen as gibberish in the log files.

View File

@@ -299,7 +299,7 @@ var stateTransitionCommand = &cli.Command{
func main() {
customFormatter := new(prefixed.TextFormatter)
customFormatter.TimestampFormat = "2006-01-02 15:04:05"
customFormatter.TimestampFormat = time.DateTime
customFormatter.FullTimestamp = true
log.SetFormatter(customFormatter)
app := cli.App{}