revert storage, remove tracing.service and bring back common

This commit is contained in:
Willy Kloucek
2022-01-07 16:06:56 +00:00
committed by Jörn Friedrich Dreyer
parent 9422388b74
commit 3c3fc2e098
114 changed files with 824 additions and 875 deletions
+13 -4
View File
@@ -3,6 +3,7 @@ package command
import (
"os"
"github.com/owncloud/ocis/ocis-pkg/log"
"github.com/owncloud/ocis/ocis-pkg/version"
"github.com/owncloud/ocis/storage/pkg/config"
"github.com/urfave/cli/v2"
@@ -22,10 +23,8 @@ func Execute(cfg *config.Config) error {
Email: "support@owncloud.com",
},
},
Before: func(c *cli.Context) error {
cfg.Service.Version = version.String
return ParseConfig(c, cfg, "_")
return ParseConfig(c, cfg, "storage")
},
Commands: []*cli.Command{
@@ -36,7 +35,6 @@ func Execute(cfg *config.Config) error {
AppProvider(cfg),
AuthBasic(cfg),
AuthBearer(cfg),
AuthMachine(cfg),
Sharing(cfg),
StorageUsers(cfg),
StorageShares(cfg),
@@ -58,3 +56,14 @@ func Execute(cfg *config.Config) error {
return app.Run(os.Args)
}
// NewLogger initializes a service-specific logger instance.
func NewLogger(cfg *config.Config) log.Logger {
return log.NewLogger(
log.Name("storage"),
log.Level(cfg.Log.Level),
log.Pretty(cfg.Log.Pretty),
log.Color(cfg.Log.Color),
log.File(cfg.Log.File),
)
}