[Proposal] SLG-0004: Metadata values privacy attribute

I have mixed opinions on this, but the big point that came to mind is this seems not general enough of a system. I almost think that metadata attributes should be like Tags in SwiftTesting.

Define the protocol, and let LogHandler libraries define the attributes they recognize and handle, telling their users to annotate their logs with those attributes for them to respond to.

Perhaps SwiftLog could define a global “public” and “private” definition of that attribute…

// SwiftLog
struct AttributedMetadata.Attribute {
  let id: String
}

// Some Library
extension AttributedMetadata.Attribute {
  @Attribute static var someLibraryAttribute
}
logger.error("", attributedMetadata: [
  "some_key": "\(myValue, attributes: .someLibraryAttribute)"
])

// user app
import SomeLogHandlerLibrary
import SomeLibrary

SomeLogHandler.setAttributePolicy([
  .someLibraryAttribute: .redact
])