MCPcopy Create free account
hub / github.com/PatchMon/PatchMon / policyIDForLog

Function policyIDForLog

server-source-code/internal/handler/patching.go:124–129  ·  view source on GitHub ↗

policyIDForLog returns a stable, log-safe identifier for a patch policy or " " when the policy is nil. Used in scheduling log lines so a parse failure can be traced back to the offending policy.

(p *db.PatchPolicy)

Source from the content-addressed store, hash-verified

122// "<none>" when the policy is nil. Used in scheduling log lines so a parse
123// failure can be traced back to the offending policy.
124func policyIDForLog(p *db.PatchPolicy) string {
125 if p == nil {
126 return "<none>"
127 }
128 return p.ID
129}
130
131// fixedTimeForLog returns the raw fixed_time_utc value (or "<nil>") for a
132// policy, suitable for inclusion in slog fields. slog escapes control

Callers 3

PreviewRunMethod · 0.85
ApproveRunMethod · 0.85
TriggerMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected