如何禁用iOS控制台过滤掉相同的消息? [英] How to disable iOS console filtering out same messages?

查看:89
本文介绍了如何禁用iOS控制台过滤掉相同的消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用iOS控制台进行NativeScript工作.

I'm doing NativeScript work, using the iOS console.

调试时,通常是console.log(something).

但是,同一事件的后续触发器将在控制台上被阻止.

However, subsequent triggers of the same event will be blocked on the console.

根据 https://docs.nativescript.org/angular/tutorial /ng-chapter-3

iOS 控制台会过滤掉类似的消息,并且只会显示一次. 这就是为什么当您继续单击按钮时,您会看到你好 仅在控制台上打印一次.将字符串"hello"替换为 在反引号字符串hello $ {new Date()}之后,以验证点击是否成功 事件确实有效.打印当前时间将确保字符串 每次都不同,控制台将不得不显示它.

The iOS console will filter out similar messages and will show them only once. That is why when you keep on clicking the button, you will see hello only printed on the console once. Replace the string "hello" with the following back-tick string hello ${new Date()} to verify that the tap event does work. Printing the current time will make sure the string is different every time and the console will have to show it.

有没有办法禁用iOS控制台的功能"?

Is there a way to disable this "feature" of iOS console?

推荐答案

作为Nick解决方法的替代方法,您可以强制控制台日志不相同:

As an alternative to Nick's workaround, you could force the console logs not to be the same:

console.log(Date.now(), "My duplicate thing");
console.log(Date.now(), "My duplicate thing");

这篇关于如何禁用iOS控制台过滤掉相同的消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆