Make log.Errf not automatically [AUDIT] level #8564
+20
−33
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Historically, all log.Err and log.Errf logs have been automatically given the [AUDIT] tag, just in case the error is significant enough that we want to track it. However, this runs counter to our goals of having regimented, structured, useful audit logs. So make Err and Errf behave exactly like their Warning/Info/Debug brethren, and not automatically add the [AUDIT] tag.
I examined all uses of these methods via a regex search for
[Ll]og.*\.Errf?\(. In each instance I made a judgement call of whether the usage a) should be upgraded to AuditErrf to retain the [AUDIT] tag, b) should be left as-is so it will be logged as a non-audit error, or c) something else entirely, like downgrading to a Warning-level log.As a result, all uses of the non-formatting log.Err function were removed, so I also removed it from the Logger interface.
Part of #8554