How to disable iOS console filtering out same messages?

孤人 提交于 2019-12-25 09:29:14

问题


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

When I debug, I usually console.log(something).

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

According to https://docs.nativescript.org/angular/tutorial/ng-chapter-3

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.

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


回答1:


As a workaround for this case, you can also print two lines of console.log instead one.

e.g.

console.log(something);
console.log("...");

And now even if the logs are identical it will print them each time even on subsequent triggers.




回答2:


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");


来源:https://stackoverflow.com/questions/45090288/how-to-disable-ios-console-filtering-out-same-messages

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!