added iso format for log ts
This commit is contained in:
parent
14eab970db
commit
888d065acf
|
@ -53,6 +53,10 @@ type SolanaCollector struct {
|
|||
NodeFirstAvailableBlock *GaugeDesc
|
||||
}
|
||||
|
||||
func init() {
|
||||
slog.Init()
|
||||
}
|
||||
|
||||
func NewSolanaCollector(
|
||||
provider rpc.Provider, slotPace time.Duration, balanceAddresses, nodekeys, votekeys []string, identity string,
|
||||
) *SolanaCollector {
|
||||
|
|
|
@ -2,13 +2,19 @@ package slog
|
|||
|
||||
import (
|
||||
"go.uber.org/zap"
|
||||
"go.uber.org/zap/zapcore"
|
||||
)
|
||||
|
||||
var log *zap.SugaredLogger
|
||||
|
||||
// Init initializes the logger
|
||||
func Init() {
|
||||
logger, _ := zap.NewProduction()
|
||||
config := zap.NewProductionConfig()
|
||||
|
||||
// Configure the encoder to use ISO8601 time format
|
||||
config.EncoderConfig.EncodeTime = zapcore.ISO8601TimeEncoder
|
||||
|
||||
logger, _ := config.Build()
|
||||
log = logger.Sugar()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue