yuhua-chen / MCLog

Xcode plugin for filtering the console area.
MIT License
586 stars 55 forks source link

xcode里,点击按钮,里面有两条打印语句,模拟器上打印俩条语句时间间隔有点长。到真机上就是只打印前一条语句。 #6

Closed jfl913 closed 8 years ago

jfl913 commented 9 years ago

xcode里,点击按钮,里面有两条打印语句,模拟器上打印俩条语句时间间隔有点长。到真机上就是只打印前一条语句。

yuhua-chen commented 9 years ago

請問是點擊什麼按鈕?還有打印什麼語句?

jfl913 commented 9 years ago
alexlee002 commented 9 years ago

不会存在只打印一条语句的情况(如果有, 麻烦给我一个简单的 demo)

最后一条语句可能会延时0.5秒左右, 因为我要准确划分每一条语句, 需要等待下一条语句到来才能分析出来, 如果0.5秒之后没有下一条语句, 那么会直接输出缓存的语句。 这是因为在 Xcode6正式版之后, console 窗口不是像原先那样能按条获取到 NSLog, 而是一次一批数据, 而且往往最后一条数据是不完整的, 需要等待下一批数据才能拼出来。

kangchuh commented 9 years ago

存在一个问题:LOG打印不同步 例如: 1、NSLog(@"1"); - 此时console不打任何东西 2、NSLog(@"2"); - 此时console打印@“1” 3、NSLog(@"3"); - 此时console打印@“2”

alexlee002 commented 9 years ago

这个问题在真机上重现了 你可以到 https://github.com/alexlee002/MCLog 去下载最新代码

但是最新代码还是存在一个问题:直接用 NSLog 输出的话, 经过测试,连续打印5万条 log, 最后一部分 log 很大几率会无法打印。 但是如果你用我在 README.md 里边的 ALLogV/I/W/E 等宏定义输出彩色 log, 就不会存在这个问题。

yuhua-chen commented 8 years ago

試試看最新版本,我使用GCD去處理打印問題。

yuhua-chen commented 8 years ago

Sine there's no response, I'm going to close this thread.