From 582649b7d4f47c450c65b18a965228a955647ab0 Mon Sep 17 00:00:00 2001 From: "A.Unger" Date: Thu, 11 Nov 2021 15:18:44 +0100 Subject: [PATCH] fix more inheritance on storages --- ocis/pkg/runtime/service/service.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/ocis/pkg/runtime/service/service.go b/ocis/pkg/runtime/service/service.go index 4f041b2a0..e27256073 100644 --- a/ocis/pkg/runtime/service/service.go +++ b/ocis/pkg/runtime/service/service.go @@ -13,6 +13,8 @@ import ( "syscall" "time" + "github.com/owncloud/ocis/ocis-pkg/shared" + mzlog "github.com/asim/go-micro/plugins/logger/zerolog/v4" "github.com/mohae/deepcopy" "github.com/olekukonko/tablewriter" @@ -159,10 +161,16 @@ func Start(o ...Option) error { FailureBackoff: 3 * time.Second, }) - s.cfg.Storage.Log.Color = s.cfg.Log.Color - s.cfg.Storage.Log.Level = s.cfg.Log.Level - s.cfg.Storage.Log.Pretty = s.cfg.Log.Pretty - s.cfg.Storage.Log.File = s.cfg.Log.File + if s.cfg.Commons == nil { + s.cfg.Commons = &shared.Commons{ + Log: &shared.Log{}, + } + } + + s.cfg.Storage.Log.Color = s.cfg.Commons.Color + s.cfg.Storage.Log.Level = s.cfg.Commons.Level + s.cfg.Storage.Log.Pretty = s.cfg.Commons.Pretty + s.cfg.Storage.Log.File = s.cfg.Commons.File if err = rpc.Register(s); err != nil { if s != nil {