Skip to content

Commit

Permalink
refactor: use time.DateTime
Browse files Browse the repository at this point in the history
Signed-off-by: hidewrong <hidewrong@outlook.com>
  • Loading branch information
hidewrong committed Jan 16, 2025
1 parent e36564c commit 4847577
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ The format is based on Keep a Changelog, and this project adheres to Semantic Ve
- Update blobs by rpc topics from V2 to V1.
- Updated geth to 1.14 ~
- E2e tests start from bellatrix
- Refactor `2006-01-02 15:04:05` to `time.DateTime`

### Deprecated

Expand Down
3 changes: 2 additions & 1 deletion cmd/beacon-chain/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmd/client-stats/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion cmd/validator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"os"
"path/filepath"
runtimeDebug "runtime/debug"
"time"

joonix "github.com/joonix/log"
"github.com/pkg/errors"
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion tools/pcli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down

0 comments on commit 4847577

Please sign in to comment.