问题
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