Shouldn't StaticString be OSLogPrivacy.public by default?

Given

        let success: Bool = doSomething()
        let logAppendage: StaticString
        
        if success {
            logAppendage = "succeeded"
        } else {
            logAppendage = "failed"
        }
        Core.logger.log("doSomething \(logAppendage)")

I was surprised that the log ended up as "doSomething <private>"

Since logAppendage is explicitly a StaticString and hence everything is known at compile time, why is it not public by default?

1 Like
Terms of Service

Privacy Policy

Cookie Policy