latitude-dev / latitude

Developer-first embedded analytics
https://latitude.so
GNU Lesser General Public License v3.0
767 stars 32 forks source link

Capture node warnings with telemetry #508

Open andresgutgon opened 3 weeks ago

andresgutgon commented 3 weeks ago

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

csansoon commented 3 weeks ago

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
})