latitude-dev / latitude

Developer-first embedded analytics

Home Page:https://latitude.so

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Capture node warnings with telemetry

andresgutgon opened this issue · comments

What?
We removed node warnings in production because in general are not helpful for users
We did it here
https://github.com/latitude-dev/latitude/pull/506/files#diff-6617ab2b81b66671c8ee19cdac270915af8f2aeafb2c43b6b31decd8bc61492fR9

But we want somehow capture this information

Maybe in telemetry

After removing all warning listeners, it no longer prints it to the user terminal, but we don't capture it either.
We can easily fix it by subscribing to the warning event right after removing all other listeners.

process.removeAllListeners('warning')
process.on('warning', info => {
  // Capture warning with telemetry
})