关于日志丢失报错解决方案

261 阅读1分钟

在运行的过程中我们可能会遇到日志日志丢失,并需要我们手动在环境变量中设置IDEPreferLogStreaming=YES的问题。 原话: Logging Error: Failed to initialize logging system. Log messages may be missing. If this issue persists, try setting IDEPreferLogStreaming=YES in the active scheme actions environment variables. 如下图所示: 截屏2024-04-24 11.15.34.png

解决方案: 在xcode Product -> Scheme -> Edit Scheme 中找到环境变量(Environment Variables),添加即可。

如下图:(图中的变量值未勾选上,需要勾选上才生效) 截屏2024-04-23 23.58.47.png