title: Xcode 12 and OSLog (os.log): wrapping OSLogMessage causes compile error: Argument must be a string interpolation
body: <p>In Xcode 12 / iOS 14, OSLog gained support for string interpolation (yay!). But it's still not possible to attach hooks to easily log to other channels, such as Crashlytics.</p>
  <p>So I figured I'll just make a simple wrapper and pass on the parameters. However, there seems to be some magic happening regarding string interpolation.</p>
  <p>The new Logger class provided, it takes a <code>OSLogMessage</code> as parameter and can be used as follows:</p>
  <pre><code>let someVar = &quot;some var&quot;
  let logger = Logger(subsystem: &quot;com.my.app&quot;, category: &quot;UI&quot;)
  
  logger.error(&quot;some message&quot;)
  logger.error(&quot;some message with default var: \(someVar)&quot;)
  logger.error(&quot;some message with private var: \(someVar, privacy: .private)&quot;)
  logger.error(&quot;some message with private var: \(someVar, privacy: .private(mask: .hash))&quot;)
  logger.error(&quot;some message with public var: \(someVar, privacy: .public)&quot;)
  </code></pre>
  <hr />
  <h1>Wrapping the new Logger struct</h1>
  <p>So lets just wrap this in a struct:</p>
  <pre><code>struct MyLogger {
      let logger = Logger(subsystem: &quot;com.my.app&quot;, category: &quot;UI&quot;)
  
      func error(_ message: OSLogMessage) {
          logger.error(message)
      }
  }
  </code></pre>
  <p>Same signature, but unfortunately, the compiler won't allow this:</p>
  <pre><code>ERROR: Argument must be a string interpolation
  </code></pre>
  <p>Furthermore, trying to call my struct also causes a weirdly specific compiler error:</p>
  <pre><code>let logger = MyLogger()
  let value = &quot;value&quot;
  logger.error(&quot;Some log message \(value, privacy: .public)&quot;)
  </code></pre>
  <p>Yields:</p>
  <pre><code>String interpolation cannot be used in this context; if you are calling an os_log function, try a different overload
  </code></pre>
  <p>Directly calling <code>os_log(_: OSLogMessage)</code> instead of the new struct gives the same result.</p>
  <p>Is there a way to work around this? Am I missing something?</p>