有时 console.log 显示在 log-ios 中,有时却没有 [英] Sometimes console.log shows in log-ios sometimes it doesn't
问题描述
我在一个终端中运行了 react-native start
,然后在另一个终端中运行了 react-native ios-run
.我最初的 console.log
很少显示,有时会显示.
I have run react-native start
in one terminal, and then react-native ios-run
in another. My initial console.log
rarely show, sometimes they do.
很多时候,我确实看到:
Lot's of times, randomly I do see:
超出日志消息配额 - 此过程中的某些消息已被丢弃
LOG MESSAGE QUOTA EXCEEDED - SOME MESSAGES FROM THIS PROCESS HAVE BEEN DISCARDED
我的 console.log
是否被丢弃了?我尝试清除控制台以更清楚地看到它,但我也找不到清除控制台的方法.
Are my console.log
's being discarded? I tried clearing the console to see it more clearly but I can't find a way to clear console either.
在 Android 上,我不会遇到缺少 console.log
的问题.
On Android, I wouldn't have issue with missing console.log
.
推荐答案
react-native 使用 syslog 守护进程记录信息.该守护进程试图防止向日志发送垃圾邮件(DoS 攻击).这些限制是基于每个进程设置的.
react-native logs information using syslog daemon. This daemon attempts to prevent spamming to the log (DoS attack). These limits are set on per process basis.
简单的解决方案是停止/启动模拟器,您将获得不受先前行为限制的新进程.
The simple solution is to stop/start simulator and you will be obtain new process that is not limited by the previous behaviour.
另一种解决方案是禁用 syslogd 限制,这将在很大程度上取决于您的操作系统.
The other solution is to disable syslogd limits what will be heavilly depends on your operation system.
这篇关于有时 console.log 显示在 log-ios 中,有时却没有的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!