propagate logging using config options
This commit is contained in:
@@ -336,9 +336,19 @@ type FrontendSutureService struct {
|
||||
}
|
||||
|
||||
// NewFrontendSutureService creates a new frontend.FrontendSutureService
|
||||
func NewFrontend(ctx context.Context) FrontendSutureService {
|
||||
func NewFrontend(ctx context.Context, o ...Option) FrontendSutureService {
|
||||
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 FrontendSutureService{
|
||||
ctx: sctx,
|
||||
|
||||
Reference in New Issue
Block a user