qwik-speak icon indicating copy to clipboard operation
qwik-speak copied to clipboard

Debug messages in config

Open mhuretski opened this issue 9 months ago • 2 comments

Hi,

Currently there's no way to turn off debug messages on local machine. It's very convenient to have them during debugging, but when everything is set up, there's no point to have them in console both on server and client.

This is non-breaking change that adds ability to turn them off.

If it's not a good fit for your vision, could you add ability to turn them off the way you see it?

mhuretski avatar May 11 '24 12:05 mhuretski

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders
Open Preview

codesandbox[bot] avatar May 11 '24 12:05 codesandbox[bot]

@mhuretski Thanks for this pr. You're right: an option to disable debugging is missing.

Unfortunately, there are two problems in your proposal:

  • this line will break dev mode, because it prevents you from running necessary code in dev mode, not just debugging
  • other debug points are missing in other parts of the library, like here

However, I don't like this "imperative" way of proceeding, that is, putting the condition for debugging at every point in the code: instead, a refactoring of the debug method would be necessary to accept a new parameter for enabling/disabling, and changing or adding a new method for this kind of debugging.

Let me know if you have time to complete this pr, otherwise I will do so when possible.

Thank you

robisim74 avatar May 13 '24 15:05 robisim74

@robisim74, updated pr

mhuretski avatar May 14 '24 06:05 mhuretski

@mhuretski Perfect! Thanks again!

robisim74 avatar May 14 '24 06:05 robisim74