PostHog / posthog-node

Official PostHog Node library
MIT License
21 stars 19 forks source link

Feature Request: Verbose Mode for Development #42

Open merrcury opened 2 years ago

merrcury commented 2 years ago

Is this related to a platform?

No

Describe the Problem.

Currently, there is no way to check, "How data is getting logged?" or "Is there some even triggering by mistake(which was not suppose to happen. of course, coding errors) or more than once(code stuck in a loop for some reason or due to packets on low latency network)?". Keep track of all of those in the PostHog Website is not so great idea while developing, It creates friction.

Solution in Mind

PostHog CLI/SDK to have a "verbose flag" while making the connection to log it into the console. In that way, Developers can have that flag turned on for the developer environment or However they feel it is right. Although This should not affect the functionality of viewing on the PostHog website.

Other Potential Advantages of it

If SDK/CLI is in verbose mode, filter those events on the website automatically.

Approach Currently in use

Manual fastlog and console to check event triggering flow. It's not the best approach for the whole DevOps cycle.

weyert commented 2 years ago

In my unit tests, I ended up, intercepting the endpoint call using msw and storing all the outgoing events in a global variable, so I could assert against it in my unit tests.