Console,\" I get timestamps in the following format:\"2011-06-06" />
开发者

NSLog Timestamps in Xcode Organizer's Console Don't Show Milliseconds

开发者 https://www.devze.com 2023-03-11 17:03 出处:网络
I am using NSLog开发者_运维百科 to record logs in an iPhone application. In Xcode when I execute my iPhone application with \"Run -> Console,\" I get timestamps in the following format:\"2011-06-06

I am using NSLog开发者_运维百科 to record logs in an iPhone application.

In Xcode when I execute my iPhone application with "Run -> Console," I get timestamps in the following format: "2011-06-06 18:34:58.189". When I view the console through the Xcode Organizer, the timestamps are in the following format: "Jun 6 18:42:51". Is there any way to ensure that the timestamps displayed in the Xcode Organizer display milliseconds?

Or would I need to write my own logging function instead of using NSLog?


I ended up using the method described here (http://blog.coriolis.ch/2009/01/09/redirect-nslog-to-a-file-on-the-iphone/) to redirect stderr to a file.


You could try using a utility I developed called NSLogger. It is much more flexible than plain NSLog, and should be able to be configured to display millisecond-precision timestamps.

0

精彩评论

暂无评论...
验证码 换一张
取 消