ios 等价于 android、Log.v、Log.d、Log.i、Log.e 等?

What the ios equivalent of android Log.v, Log.d, Log.i, Log.e, etc?

ios 等价于 android、Log.v、Log.d、Log.i、Log.e 等?同样在 android 上,我使用 Android 设备监视器和 logcat 访问我的 phone 的日志,我需要在 ios 下使用什么?特别是来自 iphone 模拟器。

Swift:

print("")

目标-C

NSLog(@"")

您可以在xcode的下角查看日志。请参考下图。

日志类型:

OS_LOG_TYPE_DEFAULT
OS_LOG_TYPE_INFO
OS_LOG_TYPE_DEBUG
OS_LOG_TYPE_ERROR
OS_LOG_TYPE_FAULT

//example   
os_log(OS_LOG_DEFAULT, "This is a log message.");

详情请参考apple reference guide