ApplicationInsights-JS icon indicating copy to clipboard operation
ApplicationInsights-JS copied to clipboard

`console.log` unnecessarily noisy

Open develohpanda opened this issue 11 months ago • 3 comments

Hi there!

I have noticed that this particular console.log is unnecessarily printing null in unit tests or a server (SSR) environment. In each of these cases, the application insights object is instantiated, but is not actually initialized - it is only initialized on the browser.

https://github.com/microsoft/ApplicationInsights-JS/blob/724d5204e3cdc50d9402d415f021d816a4c11b45/extensions/applicationinsights-debugplugin-js/src/components/styleNodeSrc.ts#L18C1-L18C29

However, in these environments, it always prints null to console and really clutters the test output.

image

I'm not sure what purpose this console.log serves; but I am happy to contribute a PR in case you have suggestions for what can be done to reduce the noise.

develohpanda avatar Mar 05 '24 23:03 develohpanda

Please feel free to submit a PR, we should not be using any console.log's, while it's in a test -- maybe it was originally for debugging.

MSNev avatar Mar 05 '24 23:03 MSNev

Oh, hangon -- is that in the debugplugin -- yikes! This should be removed.

MSNev avatar Mar 05 '24 23:03 MSNev

PR submitted! 😊

develohpanda avatar Mar 05 '24 23:03 develohpanda