propagate logging using config options

This commit is contained in:
A.Unger
2021-03-05 14:28:38 +01:00
parent 277ccc8b82
commit 074eb8d982
13 changed files with 183 additions and 40 deletions
+11 -1
View File
@@ -207,9 +207,19 @@ type StorageUsersSutureService struct {
}
// NewStorageUsersSutureService creates a new storage.StorageUsersSutureService
func NewStorageUsers(ctx context.Context) StorageUsersSutureService {
func NewStorageUsers(ctx context.Context, o ...Option) StorageUsersSutureService {
sctx, cancel := context.WithCancel(ctx)
cfg := config.New()
opts := newOptions(o...)
// merge config and options
cfg.Context = sctx
cfg.Log.Level = opts.LogLevel
cfg.Log.Pretty = opts.LogPretty
cfg.Log.Color = opts.LogColor
cfg.Context = sctx
return StorageUsersSutureService{
ctx: sctx,