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