appsignal-javascript
appsignal-javascript copied to clipboard
Possibility to disable "[APPSIGNAL]: Started in development mode."
Is your feature request related to a problem? Please describe.
Since #274 the message "[APPSIGNAL]: Started in development mode." is logged to console.warn every time the Appsignal class is constructed which bloats the test output in JavaScript tests and in feature Specs, where we throw errors if console logs warnings and errors.
Describe the solution you'd like It would be great to suppress this warning directly when instantiating the class and without providing a key – since we do not want to log errors in tests.
I am not quite sure, why this has to be logged at all – that is not clear from reading #274. I would also argue that it might be more an info than a warn. But I would propose to either enable this behavior (if really needed) through a config parameter in the constructor, or at least adding a config parameter to suppress this warning (maybe something like environment: "test" to disable it).
And before I forget it: Thanks for this lib, you are doing a grant job.
@Calamari Apologies it's taken so long to get back to you, normally I'd like to get around to commenting on issues much quicker than this, but we've been full throttle releasing Node.js stuff this week. Thanks for the kind words about the library!
I agree that this should be an info not a warn, so first, I'll get a patch out for this ASAP. To your broader point that log output should perhaps be suppressed when NODE_ENV=test (or something similar) - I think that's a good idea also. I'll schedule some time to look at this next week.
No worries about the timing. :-) We have a workaround in place right now, but of course I like to get rid of that again. Thanks for taking care.
@Calamari I'd be interested to hear about your workaround. This message annoys me a lot as well.
Still here. The console logs print on test runs, so this is really annoying.
Honestly, I don’t know anymore how I worked around this, since I don’t work on that project anymore :shrug:
Let's just remove it team. It's confusing.
Also related: https://app.intercom.com/a/apps/yzor8gyw/inbox/inbox/conversation/16410700131499
Hey all, any progress on this? Major annoyance in my test suites.
Closing this issue because it is archived on its parent project.
Could be fixed by implementing #527 -- by centralising logging, it would be possible for customers to set a lower log level and ignore this warning.