Skip to content

Excessive Logs #479

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ExcelNet-Public opened this issue Apr 15, 2019 · 13 comments
Closed

Excessive Logs #479

ExcelNet-Public opened this issue Apr 15, 2019 · 13 comments

Comments

@ExcelNet-Public
Copy link

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!

@nativescript-vue-bot
Copy link
Collaborator

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.

@HugoAntares
Copy link

+1

@rigor789
Copy link
Member

Vue.config.silent = true

@ExcelNet-Public
Copy link
Author

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.

@coffeeneed
Copy link

Vue.config.silent = true

Where?

@coffeeneed
Copy link

Answer: main.js

@SpurguX
Copy link

SpurguX commented Oct 23, 2019

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...

@maxorlovsky
Copy link

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.

@coffeeneed
Copy link

Yes! What @maxorlovsky wrote. We can't have all these render logs. Makes no sense for me, at least. Please add this option!

@meyt
Copy link

meyt commented Mar 13, 2020

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)
}

Docs

@tanc
Copy link

tanc commented Apr 20, 2020

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.

@rigor789
Copy link
Member

Indeed!

@nativescript-vue-bot
Copy link
Collaborator

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.

@nativescript-vue nativescript-vue locked as resolved and limited conversation to collaborators May 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

9 participants