mirror of https://github.com/databricks/cli.git
Remove redundant logging after every mutator
This commit is contained in:
parent
d8dcea79c8
commit
c657006530
|
@ -35,17 +35,7 @@ func Apply(ctx context.Context, b *Bundle, m Mutator) diag.Diagnostics {
|
|||
}
|
||||
}()
|
||||
|
||||
diags := m.Apply(ctx, b)
|
||||
|
||||
// Log error in diagnostics if any.
|
||||
// Note: errors should be logged when constructing them
|
||||
// such that they are not logged multiple times.
|
||||
// If this is done, we can omit this block.
|
||||
if err := diags.Error(); err != nil {
|
||||
log.Errorf(ctx, "Error: %s", err)
|
||||
}
|
||||
|
||||
return diags
|
||||
return m.Apply(ctx, b)
|
||||
}
|
||||
|
||||
type funcMutator struct {
|
||||
|
|
|
@ -20,10 +20,5 @@ func ApplyReadOnly(ctx context.Context, rb ReadOnlyBundle, m ReadOnlyMutator) di
|
|||
ctx = log.NewContext(ctx, log.GetLogger(ctx).With("mutator (read-only)", m.Name()))
|
||||
|
||||
log.Debugf(ctx, "ApplyReadOnly")
|
||||
diags := m.Apply(ctx, rb)
|
||||
if err := diags.Error(); err != nil {
|
||||
log.Errorf(ctx, "Error: %s", err)
|
||||
}
|
||||
|
||||
return diags
|
||||
return m.Apply(ctx, rb)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue