• Obviously for production probably best to remove any console.log() entries inside widget.js code.

    What is the impact when not connected through the IDE of leaving console.log() calls in place ?
    Does the watch just detect that no IDE is connected and just ignore them ?

  • Nope, those messages have to go somewhere, and may cause issues. Or will print the console messages on the screen (might not be visible, because it's overwritten by other code, but might cause visible problems)

  • Well, yes and no...

    • If nothing is connected, and 'Show Debug Info' is set to 'Hide' then they're ignored
    • If nothing is connected, and 'Show Debug Info' is set to 'Show' then they're written to the screen
    • If anything is connected then they'll be sent over Bluetooth - so for instance if you're using Gadgetbridge it'll be getting the data and then just failing to parse it and ignoring it.

    Basically I'd leave them out if you can. What you could do is do var DBG = print; or var DBG = function(){}; then you just call DBG("My info") in your code and you can swap over easily.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

what is the impact of leaving console.log() in widget code?

Posted by Avatar for HughB @HughB

Actions