Skip to content

Instantly share code, notes, and snippets.

@choefele
Last active August 29, 2015 14:21
Show Gist options
  • Save choefele/3bbdc9b7146f69b0cb70 to your computer and use it in GitHub Desktop.
Save choefele/3bbdc9b7146f69b0cb70 to your computer and use it in GitHub Desktop.
NSLogger – startNSLogger()
private class func startNSLogger() {
let paths = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true);
let file = "\(paths.first!)/loggerdata"
let bundleName = NSBundle.mainBundle().objectForInfoDictionaryKey(kCFBundleNameKey as String) as! String
let logger = LoggerInit()
LoggerSetBufferFile(logger, file)
LoggerSetOptions(logger, UInt32(kLoggerOption_BufferLogsUntilConnection | kLoggerOption_BrowseBonjour | kLoggerOption_BrowseOnlyLocalDomain))
LoggerSetupBonjour(logger, nil, bundleName)
LoggerStart(nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment