Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I import the new logging functions in iOS 10 / Sierra / Xcode 8?

Tags:

There is a new logging system in iOS 10 and macOS Sierra.

But I can't seem to make it work in Xcode. os_log is not recognized, and neither is any other function / constant mentioned in the docs.

Use of unresolved identifier 'os_log'

Do I need to link a framework or import a header or something? Am I missing something obvious?

like image 580
Tom Hamming Avatar asked Sep 28 '16 17:09

Tom Hamming


1 Answers

In Swift:

import os  os_log("Some message") 

In Objective-C:

#import <os/log.h>  os_log(OS_LOG_DEFAULT, "Some message"); 
like image 76
rmaddy Avatar answered Sep 29 '22 00:09

rmaddy