mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-08 23:18:15 -05:00
Signed-off-by: hidewrong <hidewrong@outlook.com> (#14792)
Signed-off-by: hidewrong <hidewrong@outlook.com>
This commit is contained in:
2
changelog/hidewrong_use_time.DateTime.md
Normal file
2
changelog/hidewrong_use_time.DateTime.md
Normal file
@@ -0,0 +1,2 @@
|
||||
### Changed
|
||||
- Refactor `2006-01-02 15:04:05` to `time.DateTime`
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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{}
|
||||
|
||||
Reference in New Issue
Block a user