fix: need to not return logger, but decorate the one we do have and replace with the one in the config

This commit is contained in:
Derrick Hammer 2024-01-30 14:32:46 -05:00
parent e477d681d4
commit 3a49375638
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 3 additions and 2 deletions

View File

@ -48,12 +48,14 @@ type S5ProtocolResult struct {
S5Protocol *S5Protocol
S5NodeConfig *s5config.NodeConfig
Db *bolt.DB
Logger *zap.Logger
}
var ProtocolModule = fx.Module("s5_api",
fx.Provide(NewS5Protocol),
fx.Provide(NewS5ProviderStore),
fx.Decorate(func(cfg *s5config.NodeConfig) *zap.Logger {
return cfg.Logger
}),
s5fx.Module,
)
@ -77,7 +79,6 @@ func NewS5Protocol(
S5Protocol: proto,
S5NodeConfig: cfg,
Db: cfg.DB,
Logger: params.Logger,
}, nil
}