title: Swift app crashes only when archived (exported). NSLog related
body: <p>I have a macOS app in swift that <strong>crashes only when archived</strong> (not run from XCode).</p>
  
  <p>It crashes on the following code:</p>
  
  <pre><code>private static func myFunc(originalValue: String) {
      DLog("Starting myFunc on: '\(originalValue)'") // CRASHES when app is exported
  }
  </code></pre>
  
  <p>Here is the DLog function (when exported, the DEBUG flag is not set, so it will not execute the NSLog):</p>
  
  <pre><code>func DLog(_ message: String, function: String = #function) {
      #if DEBUG
          NSLog("%@, %@", function, message)
      #endif
  }
  </code></pre>
  
  <p>The <code>originalValue</code> that makes the app crash is a String containing basic characters (letters or numbers), no <code>%@</code> or other format string stuff.</p>
  
  <p>Now the funniest part, if I print (using Swift.print) <code>originalValue</code> before calling <code>DLog</code>, it won't crash: </p>
  
  <pre><code>private static func myFunc(originalValue: String) {
      print("Starting myFunc on: '\(originalValue)'") // prevents the crash
      DLog("Starting myFunc on: '\(originalValue)'") // DOES NOT crash because of the print before
  }
  </code></pre>
  
  <p>Any logical explanation to this strange behavior?</p>
  
  <p>Thanks!</p>