Catching as many errors and warnings from browser console via JS to send back to stat server

So I work with some devs that don’t track errors and I want to be able to make an easy to use way to log all the errors and issues on the client side to be sent back to the server for analysis.

So far I have over ridden console.log to look for key words like Error or Invalid and also logs the current URL and time the error was detected on but is there a better way to record problems to be sent back to me for analysis?

I was thinking of making a little lib that devs could import and has a few decorator functions and hooks to help track bugs.

Any libraries/toolkits or standard methods/practises I could use?

Thanks.