question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Disable system log in TNS 4 console

See original GitHub issue

Hello,

I’am using NativeScript Vue for developing my app, however, since upgrading to TNS 4, the tns console output log is too much verbose with system logging messages. Is there any way to disable all these logs and print only application level logs ?

Every time I run the app, it’s impossible to see my debug log since there are a lot of system logs, for example:

AVAudioSession.mm:323:HandleRouteChange: Posting AVAudioSessionRouteChangeNotification. Reason: 3 0x10293e818 - UIProcess is releasing a foreground assertion because the view is no longer visible 0x10b944210 - ProcessThrottler::updateAssertion() sending PrepareToSuspend IPC 0x1c4a6ab80 - ProcessAssertion::setState(1) 0x10b944000 - WebProcessProxy::didSetAssertionState(Background) taking background assertion for network process 0x10b940138 - ProcessThrottler::updateAssertionNow() updating process assertion state to 1 (foregroundActivities: 0, backgroundActivities: 1) 0x1c4a6a980 - ProcessAssertion::setState(1) 0x10b944210 - ProcessThrottler::updateAssertionNow() updating process assertion state to 0 (foregroundActivities: 0, backgroundActivities: 0) 0x1c4a6ab80 - ProcessAssertion::setState(0) 0x10b944000 - WebProcessProxy::didSetAssertionState(Suspended) release all assertions for network process 0x10b940138 - ProcessThrottler::updateAssertion() sending PrepareToSuspend IPC 0x10b940138 - ProcessThrottler::updateAssertionNow() updating process assertion state to 0 (foregroundActivities: 0, backgroundActivities: 0) 0x1c4a6a980 - ProcessAssertion::setState(0) 0x1c4854640 - WKProcessAssertionBackgroundTaskManager - endBackgroundTask 0x10b944210 - ProcessThrottler::updateAssertionNow() updating process assertion state to 1 (foregroundActivities: 0, backgroundActivities: 1) 0x1c4a6ab80 - ProcessAssertion::setState(1) 0x1c4854640 - WKProcessAssertionBackgroundTaskManager - beginBackgroundTaskWithName 0x10b944000 - WebProcessProxy::didSetAssertionState(Background) taking background assertion for network process 0x10b940138 - ProcessThrottler::updateAssertionNow() updating process assertion state to 1 (foregroundActivities: 0, backgroundActivities: 1) 0x1c4a6a980 - ProcessAssertion::setState(1) 0x10b944000 - WebProcessProxy::didSetAssertionState(Background) taking background assertion for network process 0x10b944000 - WebProcessProxy::didSetAssertionState(Background) taking background assertion for network process 0x10b944000 - WebProcessProxy::didSetAssertionState(Background) taking background assertion for network process 0x10b944000 - WebProcessProxy::didSetAssertionState(Background) taking background assertion for network process 0x10b944000 - WebProcessProxy::didSetAssertionState(Background) taking background assertion for network process 0x10b944000 - WebProcessProxy::didSetAssertionState(Background) taking background assertion for network process 0x10b944210 - ProcessThrottler::updateAssertion() sending PrepareToSuspend IPC 0x10b944000 - WebProcessProxy::didSetAssertionState(Background) taking background assertion for network process 0x10b944000 - WebProcessProxy::didSetAssertionState(Background) taking background assertion for network process 0x10b944000 - WebProcessProxy::didSetAssertionState(Background) taking background assertion for network process 0x10b944000 - WebProcessProxy::didSetAssertionState(Background) taking background assertion for network process 0x10b944000 - WebProcessProxy::didSetAssertionState(Background) taking background assertion for network process 0x10b944000 - WebProcessProxy::didSetAssertionState(Background) taking background assertion for network process 0x10b944000 - WebProcessProxy::didSetAssertionState(Background) taking background assertion for network process 0x10b944000 - WebProcessProxy::didSetAssertionState(Background) taking background assertion for network process 0x10b944000 - WebProcessProxy::didSetAssertionState(Background) taking background assertion for network process

Issue occurs since TNS 4.0

  • Both iOS/Android

To recreate the issue

  • Execute command tns [run|debug] [ios|andorid] for any NativeScript project.

Thank you for any help.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:14

github_iconTop GitHub Comments

4reactions
speiggcommented, Aug 7, 2018

The only workaround I have so far is to manually edit ios-log-filter.js by adding additional filtering conditions:

preFilter(data, currentLine) {
        return currentLine.length < 1 ||
            currentLine.indexOf("WebProcessProxy") !== -1 ||
            currentLine.indexOf("ProcessAssertion") !== -1 ||
            currentLine.indexOf("ProcessThrottler") !== -1 ||
            currentLine.indexOf("locationd") !== -1 ||
            currentLine.indexOf("SecTaskCopyDebugDescription") !== -1 ||
            currentLine.indexOf("NativeScript loaded bundle") !== -1 ||
            (currentLine.indexOf("assertion failed:") !== -1 && data.indexOf("libxpc.dylib") !== -1);
}

This is obviously a hack (and still misses a ton of system logs), but at least (for now) I can filter out the noisiest system logs so I can see more of my own.


EDIT:

This works better…

preFilter(data, currentLine) {
        return currentLine.length < 1 || currentLine.indexOf("CONSOLE") === -1 ;
}
3reactions
fhackenbcommented, Nov 6, 2018

I’m having the same issue, @speigg @GrEg00z where is the ios-log-filter.js file located?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Enabling and disabling logging - IBM
Under Request Metrics Destination, select the Standard Logs check box to enable the logging feature. To disable the logging , clear the Standard...
Read more >
Disable log output to the Rails console - ruby - Stack Overflow
It pollutes my console. Is there a way to disable that behavior? Note that I want to silence all the logs, not only...
Read more >
Using boolean in custom metadata type to enable/disable ...
debug is written into the debug log. I wonder if the same is recommended for LWC development to show console.log in the browser...
Read more >
How to Set Up and Manage Logging on a Switch | Dell UK
Disable Logging ; console# configure, Enter configuration mode. ; console(conf)# no logging on, Disable all logging except to the console.
Read more >
TNS Fortigate FortiOS Best Practices v2.0.0 | Tenable®
Audit details for TNS Fortigate FortiOS Best Practices v2.0.0. ... Event Logging is not available or enabled - Event Logging category checks ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found