(ctx context.Context, p *policy.LoggingPolicy, changeCount *int)
| 29 | } |
| 30 | |
| 31 | func (c *policyLoggingFlags) setLoggingPolicyFromFlags(ctx context.Context, p *policy.LoggingPolicy, changeCount *int) error { |
| 32 | if err := applyPolicyLogDetailPtr(ctx, "directory snapshotted detail", &p.Directories.Snapshotted, c.dirSnapshottedDetail, changeCount); err != nil { |
| 33 | return errors.Wrap(err, "directory snapshotted detail") |
| 34 | } |
| 35 | |
| 36 | if err := applyPolicyLogDetailPtr(ctx, "directory ignored detail", &p.Directories.Ignored, c.dirIgnoredDetail, changeCount); err != nil { |
| 37 | return errors.Wrap(err, "directory ignored detail") |
| 38 | } |
| 39 | |
| 40 | if err := applyPolicyLogDetailPtr(ctx, "entry snapshotted detail", &p.Entries.Snapshotted, c.entrySnapshottedDetail, changeCount); err != nil { |
| 41 | return errors.Wrap(err, "entry snapshotted detail") |
| 42 | } |
| 43 | |
| 44 | if err := applyPolicyLogDetailPtr(ctx, "entry ignored detail", &p.Entries.Ignored, c.entryIgnoredDetail, changeCount); err != nil { |
| 45 | return errors.Wrap(err, "entry ignored detail") |
| 46 | } |
| 47 | |
| 48 | if err := applyPolicyLogDetailPtr(ctx, "entry cache hit detail", &p.Entries.CacheHit, c.entryCacheHitDetail, changeCount); err != nil { |
| 49 | return errors.Wrap(err, "entry cache hit detail") |
| 50 | } |
| 51 | |
| 52 | if err := applyPolicyLogDetailPtr(ctx, "entry cache miss detail", &p.Entries.CacheMiss, c.entryCacheMissDetail, changeCount); err != nil { |
| 53 | return errors.Wrap(err, "entry cache miss detail") |
| 54 | } |
| 55 | |
| 56 | return nil |
| 57 | } |
| 58 | |
| 59 | func applyPolicyLogDetailPtr(ctx context.Context, desc string, val **policy.LogDetail, str string, changeCount *int) error { |
| 60 | if str == "" { |
no test coverage detected