refactored log handling

Signed-off-by: Richard Jones <richard@dagger.io>
This commit is contained in:
Richard Jones 2021-12-13 12:45:38 -07:00
parent a78b84429d
commit 6ca81dacf9

View File

@ -26,16 +26,14 @@ func (c serviceTask) Run(ctx context.Context, pctx *plancontext.Context, s solve
return nil, errors.New("invalid service")
}
lg := log.Ctx(ctx).Debug()
lg := log.Ctx(ctx)
if unix != "" {
lg.Str("unix", unix)
lg.Debug().Str("unix", unix).Msg("loading service")
} else if npipe != "" {
lg.Str("npipe", npipe)
lg.Debug().Str("npipe", npipe).Msg("loading service")
}
lg.Msg("loading service")
service := pctx.Services.New(unix, npipe)
out := compiler.NewValue()
if err := out.FillPath(cue.ParsePath("service"), service.MarshalCUE()); err != nil {