add logger to options
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/unistack-org/micro/v3/logger"
|
||||
"github.com/unistack-org/micro/v3/registry"
|
||||
)
|
||||
|
||||
@@ -19,10 +20,12 @@ type Options struct {
|
||||
Network string
|
||||
// Registry is the local registry
|
||||
Registry registry.Registry
|
||||
// Context for additional options
|
||||
Context context.Context
|
||||
// Precache routes
|
||||
Precache bool
|
||||
// Logger
|
||||
Logger logger.Logger
|
||||
// Context for additional options
|
||||
Context context.Context
|
||||
}
|
||||
|
||||
// Id sets Router Id
|
||||
@@ -53,6 +56,13 @@ func Network(n string) Option {
|
||||
}
|
||||
}
|
||||
|
||||
// Logger sets the logger
|
||||
func Logger(l logger.Logger) Option {
|
||||
return func(o *Options) {
|
||||
o.Logger = l
|
||||
}
|
||||
}
|
||||
|
||||
// Registry sets the local registry
|
||||
func Registry(r registry.Registry) Option {
|
||||
return func(o *Options) {
|
||||
|
||||
Reference in New Issue
Block a user