mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-05-20 20:08:42 -05:00
better better logging
This commit is contained in:
+10
-5
@@ -9,7 +9,11 @@ import (
|
||||
"github.com/oklog/run"
|
||||
"github.com/owncloud/ocis-accounts/pkg/config"
|
||||
"github.com/owncloud/ocis-accounts/pkg/micro/grpc"
|
||||
olog "github.com/owncloud/ocis-pkg/v2/log"
|
||||
oclog "github.com/owncloud/ocis-pkg/v2/log"
|
||||
)
|
||||
|
||||
var (
|
||||
logger oclog.Logger
|
||||
)
|
||||
|
||||
// Server is the entry point for the server command.
|
||||
@@ -60,16 +64,17 @@ func Server(cfg *config.Config) *cli.Command {
|
||||
Destination: &cfg.Server.Address,
|
||||
},
|
||||
},
|
||||
Before: func(c *cli.Context) error {
|
||||
logger = oclog.NewLogger(oclog.Name(cfg.Server.Name))
|
||||
return nil
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
gr := run.Group{}
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
l := olog.NewLogger(
|
||||
olog.Name(cfg.Server.Name),
|
||||
)
|
||||
|
||||
defer cancel()
|
||||
service := grpc.NewService(
|
||||
grpc.Logger(l),
|
||||
grpc.Logger(logger),
|
||||
grpc.Context(ctx),
|
||||
grpc.Config(cfg),
|
||||
grpc.Name(cfg.Server.Name),
|
||||
|
||||
@@ -34,7 +34,7 @@ type Store struct {
|
||||
// New creates a new store
|
||||
func New(cfg *config.Config) account.Manager {
|
||||
s := Store{
|
||||
Logger: olog.NewLogger(olog.Name("ocis-accounts")),
|
||||
Logger: olog.NewLogger(olog.Name(cfg.Server.Name)),
|
||||
}
|
||||
|
||||
dest := filepath.Join(cfg.MountPath, StoreName)
|
||||
|
||||
Reference in New Issue
Block a user