关于os_log打印隐私

时间:2018-09-11 09:02:32

标签: logging operating-system private

我想知道os_log如何区分指针是指向静态还是动态字符串?例如

os_log_t log = os_log_create("com.example.my-subsystem", "test")

const char *staticString = "I am static string!";

const char *dynamicString = [[NSString stringWithFormat:@"I am %@!", @"dynamic string"]  cStringUsingEncoding:NSUTF8StringEncoding];
os_log(log, "Message: %s", staticString); //print I am static string
os_log(log, "Message: %s", dynamicString); // print <private>

0 个答案:

没有答案