mirror of
https://github.com/sot-tech/mochi.git
synced 2026-05-03 10:57:56 -07:00
*: add structured logging
This commit is contained in:
@@ -52,6 +52,15 @@ type Config struct {
|
||||
ShardCount int `yaml:"shard_count"`
|
||||
}
|
||||
|
||||
// LogFields renders the current config as a set of Logrus fields.
|
||||
func (cfg Config) LogFields() log.Fields {
|
||||
return log.Fields{
|
||||
"gcInterval": cfg.GarbageCollectionInterval,
|
||||
"peerLifetime": cfg.PeerLifetime,
|
||||
"shardCount": cfg.ShardCount,
|
||||
}
|
||||
}
|
||||
|
||||
// New creates a new PeerStore backed by memory.
|
||||
func New(cfg Config) (storage.PeerStore, error) {
|
||||
shardCount := 1
|
||||
|
||||
Reference in New Issue
Block a user