我想将我的多线程项目中的所有日志消息转换为使用 Apple 系统日志工具(或 asl)。
根据以下 asl 手册 - https: //developer.apple.com/library/ios/documentation/System/Conceptual/ManPages_iPhoneOS/man3/asl_get.3.html
从多个线程记录时,每个线程必须使用 asl_open 打开一个单独的客户端句柄。
出于这个原因,我为每个线程定义了 asl 客户端,以在我的所有日志命令中使用。但是,在将 asl 客户端绑定到每个 asl_log 命令时面临一些重大困难。
1. what if some of my asl log commands reside in a code that is common for
more than one thread - which asl client should i decide use on such message.
2. Even on thread unique code, one should be consistent in choosing the same
asl_client on all log functions on a single thread code scope (this is
not always easy to find in complex projects.).
有没有更简单的方法来采用我的项目日志消息来使用 asl ?
我会考虑将 asl 客户端绑定到线程之类的东西,
谢谢