Get console logs from quasar cordova app

  • Is there any way or plugin for cordova, quasar to get logs (most of all the errors) as a text for sending them by REST to server?

  • There are literally dozens of ways you could do this - and you can find them with a cursory google search. Just as an example, if you wanted to roll your own, write a vue prototype plugin that makes an axios post to your endpoint. Easy. 😉 You could also look into if you want a service for that - but both of these options really depend on your app having network access, and if doesn’t even have that then you’ll never know…

    But this isn’t the real problem - the problem is that your code has errors. Maybe your promises are never resolving, maybe you expect a parameter to have a value - but it is undefined when it is used. Maybe it works on an emulator, but not on a real device. The REAL question you should be asking yourself is how to make your code more resilient. I think that is a better way to spend your time than integrating some remote error logging stuff.

    How do you do that?

    • compare, don’t coerce object types
    • use typeof to control object types
    • use try{} catch(){} to control against unexpected behaviour
    • track down unexpected behavior so you can remove try / catch
    • build unit tests and run them like your app depends on it
    • read the ecmascript spec

    And finally: stop using console.log - because it is a blocking operation that WILL slow down your app.

  • Thank you very much for your detailed reply. But I think that you will not argue that you cannot write perfect code all the time and sometimes errors happen wich you can’t recognize during development and they appear in the realese. The easiest way to find out the reason of error is to look at error stack trace.
    I thought maybe there is some plugin for Cordova\Quasar for these purposes.