Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):
CLI: 5.2.0
Cross-platform modules:
Android Runtime: 5.2.0
iOS Runtime: 5.2.0
Plugin(s):
How can I prevent application logs in the console output?
CONSOLE LOG file:///app/vendor.js:33228:14: '{NSVue (Vue: 2.5.17 | NSVue: 2.0.2)} -> CreateElement(NativePage)'
CONSOLE LOG file:///app/vendor.js:33228:14: '{NSVue (Vue: 2.5.17 | NSVue: 2.0.2)} -> CreateElement(nativeflexboxlayout)'
CONSOLE LOG file:///app/vendor.js:33228:14: '{NSVue (Vue: 2.5.17 | NSVue: 2.0.2)} -> CreateElement(nativegridlayout)'
CONSOLE LOG file:///app/vendor.js:33228:14: '{NSVue (Vue: 2.5.17 | NSVue: 2.0.2)} -> CreateElement(nativelabel)'
CONSOLE LOG file:///app/vendor.js:33228:14: '{NSVue (Vue: 2.5.17 | NSVue: 2.0.2)} -> AppendChild(ElementNode(nativegridlayout), ElementNode(nativelabel))'
CONSOLE LOG file:///app/vendor.js:33228:14: '{NSVue (Vue: 2.5.17 | NSVue: 2.0.2)} -> CreateElement(nativestacklayout)'
CONSOLE LOG file:///app/vendor.js:33228:14: '{NSVue (Vue: 2.5.17 | NSVue: 2.0.2)} -> CreateElement(nativebutton)'
CONSOLE LOG file:///app/vendor.js:33228:14: '{NSVue (Vue: 2.5.17 | NSVue: 2.0.2)} -> AppendChild(ElementNode(nativestacklayout), ElementNode(nativebutton))'
CONSOLE LOG file:///app/vendor.js:33228:14: '{NSVue (Vue: 2.5.17 | NSVue: 2.0.2)} -> CreateElement(nativebutton)'
CONSOLE LOG file:///app/vendor.js:33228:14: '{NSVue (Vue: 2.5.17 | NSVue: 2.0.2)} -> AppendChild(ElementNode(nativestacklayout), ElementNode(nativebutton))'
CONSOLE LOG file:///app/vendor.js:33228:14: '{NSVue (Vue: 2.5.17 | NSVue: 2.0.2)} -> CreateElement(nativebutton)'
CONSOLE LOG file:///app/vendor.js:33228:14: '{NSVue (Vue: 2.5.17 | NSVue: 2.0.2)} -> AppendChild(ElementNode(nativestacklayout), ElementNode(nativebutton))'
CONSOLE LOG file:///app/vendor.js:33228:14: '{NSVue (Vue: 2.5.17 | NSVue: 2.0.2)} -> CreateElement(nativebutton)'
CONSOLE LOG file:///app/vendor.js:33228:14: '{NSVue (Vue: 2.5.17 | NSVue: 2.0.2)} -> AppendChild(ElementNode(nativestacklayout), ElementNode(nativebutton))'
CONSOLE LOG file:///app/vendor.js:33228:14: '{NSVue (Vue: 2.5.17 | NSVue: 2.0.2)} -> CreateElement(nativebutton)'
CONSOLE LOG file:///app/vendor.js:33228:14: '{NSVue (Vue: 2.5.17 | NSVue: 2.0.2)} -> AppendChild(ElementNode(nativestacklayout), ElementNode(nativebutton))'
CONSOLE LOG file:///app/vendor.js:33228:14: '{NSVue (Vue: 2.5.17 | NSVue: 2.0.2)} -> AppendChild(ElementNode(nativegridlayout), ElementNode(nativestacklayout))'
CONSOLE LOG file:///app/vendor.js:33228:14: '{NSVue (Vue: 2.5.17 | NSVue: 2.0.2)} -> AppendChild(ElementNode(nativeflexboxlayout), ElementNode(nativegridlayout))'
CONSOLE LOG file:///app/vendor.js:33228:14: '{NSVue (Vue: 2.5.17 | NSVue: 2.0.2)} -> AppendChild(ElementNode(nativepage), ElementNode(nativeflexboxlayout))'
This makes debugging much more difficult. An option of some sort to disable the CreateElement / AppendChild messages would be welcomed. Through some sort of flag of course to enable should they be needed but at this point they seem clutter looking for real console log messages.
Thanks!
Your issue has been tagged as low priority because it did not follow our issue guidelines.
If you believe your issue should be higher priority please close this issue and create a new one
using the issue helper.
Thanks for your understanding.
+1
Vue.config.silent = true
That definitely eliminates those messages. However, I suspect it suppresses more than just the UI creation messages though I have not really read all of the code.
Vue.config.silent = true
Where?
Answer: main.js
The disadvantage with Vue.config.silent = true is that it indeed suppresses more than just the UI creation messages.
For instance warnings such as the following will be omitted.
[Vue warn]: Error in render: "TypeError: _vm.someObject.someFunction is not a function"
Not seeing the warnings slowed down debugging for me so I turned the logs back on. Would be nice to get rid of the excess logs though...
Proposing to have a Vue.config.suppressRenderLogs = true to suppress just rendering logs in my PR, but still leave Vue warns and console errors to be displayed.
Yes! What @maxorlovsky wrote. We can't have all these render logs. Makes no sense for me, at least. Please add this option!
I use this instead of the full silence:
Vue.config.warnHandler = function (msg, vm, info) {
console.log('Vue WARN', msg)
}
Vue.config.errorHandler = function (err, vm, info) {
console.log('Vue ERROR', err)
}
I think this issue can be closed as maxorlovsky's work has been merged and I can confirm adding
Vue.config.suppressRenderLogs = true
in main.js has completely removed the render log noise for me.
Indeed!
We are locking this issue because it has been closed for more than 14 days.
If the issue comes up again please open a new issue with additional details.
Most helpful comment
Proposing to have a
Vue.config.suppressRenderLogs = trueto suppress just rendering logs in my PR, but still leave Vue warns and console errors to be displayed.