title: How to use Crashlytics logging in Swift?
body: <p><a href="http://support.crashlytics.com/knowledgebase/articles/92519-how-do-i-use-logging" rel="noreferrer">This</a> article describes how to use Crashlytics logging in objective-c. However, after going throught the installation steps for propertly referencing Crashlytics and Fabric into my project, I don't seem to have access to that method.</p>
  
  <p>Looking at the Crashlytics.h file, I can see it defined using compiler flags:</p>
  
  <pre><code>#ifdef DEBUG
  #define CLS_LOG(__FORMAT__, ...) CLSNSLog((@"%s line %d $ " __FORMAT__), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
  #else
  #define CLS_LOG(__FORMAT__, ...) CLSLog((@"%s line %d $ " __FORMAT__), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
  #endif
  </code></pre>
  
  <p>This block just appears to wrap the <code>CLSNLog</code> and the <code>CLSLog</code> functions depending on the compiler flag.</p>
  
  <p>So, thinking I'd just go straight to the source, I tried to reference CLSLog directly from a swift file. Still no luck:</p>
  
  <p>My-Bridging-Header.h:</p>
  
  <pre><code>#import &lt;Crashlytics/Crashlytics.h&gt;
  </code></pre>
  
  <p>Log.swift:</p>
  
  <pre><code>import Foundation
  import Fabric
  import Crashlytics
  
  func Log(message: String) {
      NSLog("%@", message)
      CLS_LOG("%@", message)
      CLSLog("%@", message)
  }
  </code></pre>
  
  <p>The last two lines in the Log function throw the error, <code>Use of unresolved identifier</code>. Crashlytics crash reporting works just fine, except for the logging feature. According to <a href="http://www.crashlytics.com/blog/crashlytics-november-2014-update/" rel="noreferrer">this</a> article, logging support for Swift has been implemented.</p>
  
  <p>As far as versions go, I'm running the latest version of Fabric/Crashlytics (December release, at the time of this post).</p>
  
  <p><em>(Interesting note, I can see/use <code>CLSLogv()</code>...)</em></p>
  
  <p>Does anyone know the correct way to incorporate <code>CLS_LOG</code> for use in a Swift project?</p>