Live data from Hacker News

Show HN: Proxino -- Monitor and Debug your JavaScript

proxino.com

31–40 of 49 posts

Re: Show HN: Proxino -- Monitor and Debug your JavaScript

#31

For hackers: window.onerror = function(m, f, l){ var err = JSON.encode({ message:m, file:f, line:l }) (new Image).src = '/errors?e='+err } For Google Analytics users: window.onerror = function(m, f, l){ var err = [f, l, m].join(' : ') _gaq.push(['_trackEvent', 'Errors', 'App', err, null, true]) } Analytics will allow you to filter by OS, browser, and all the other environment data it already captures. And nice graphs…

For some reason I thought they were doing more than this, like proxying your JavaScript (hence PROXino), instrumenting it with try/catches to provide robust stack traces, but apparently not: https://www.proxino.com/p.js

Re: Show HN: Proxino -- Monitor and Debug your JavaScript

#33
post #16

There are already services (like Sentry) that track errors well. I want a service that focuses on the non-error logging part. I typically develop my JS with a lot of console.log calls. Let's say a hundred at page load, and more for each user action, and when there's new data coming down from the server. I'm trying to fix a bug that my friend is having on my new project, but I can't reproduce it locally. I want to see…

Personally, I use Loggr (http://loggr.net) for tracking errors and events. You can tag your events however you want so it is really easy to track user sessions and so on.

Re: Show HN: Proxino -- Monitor and Debug your JavaScript

#34

For hackers: window.onerror = function(m, f, l){ var err = JSON.encode({ message:m, file:f, line:l }) (new Image).src = '/errors?e='+err } For Google Analytics users: window.onerror = function(m, f, l){ var err = [f, l, m].join(' : ') _gaq.push(['_trackEvent', 'Errors', 'App', err, null, true]) } Analytics will allow you to filter by OS, browser, and all the other environment data it already captures. And nice graphs…

For some reason I thought they were doing more than this, like proxying your JavaScript (hence PROXino), instrumenting it with try/catches to provide robust stack traces, but apparently not: https://www.proxino.com/p.js

That's what the old version of Proxino did... but potential customers didn't like the proxy.

Re: Show HN: Proxino -- Monitor and Debug your JavaScript

#35
post #30

For hackers: window.onerror = function(m, f, l){ var err = JSON.encode({ message:m, file:f, line:l }) (new Image).src = '/errors?e='+err } For Google Analytics users: window.onerror = function(m, f, l){ var err = [f, l, m].join(' : ') _gaq.push(['_trackEvent', 'Errors', 'App', err, null, true]) } Analytics will allow you to filter by OS, browser, and all the other environment data it already captures. And nice graphs…

Why wrap everything in json? Then you'll just have to decode it on the other end. Just use url parameters, it's what they are for: (new Image).src = '/errors?m='+encodeURIComponent(m)+ '&f='+encodeURIComponent(f)+'&l='+encodeURIComponent(l); This way it also works on browsers that don't have native JSON (old IE mainly, but also firefox before 3.5). And those are also exactly the browsers where you are likely to get e…

Currently it's usually easier to decode JSON than to parse a query string. Modify to taste.

You don't need to encode the strings, the browser will do that for src.

Re: Show HN: Proxino -- Monitor and Debug your JavaScript

#36

For hackers: window.onerror = function(m, f, l){ var err = JSON.encode({ message:m, file:f, line:l }) (new Image).src = '/errors?e='+err } For Google Analytics users: window.onerror = function(m, f, l){ var err = [f, l, m].join(' : ') _gaq.push(['_trackEvent', 'Errors', 'App', err, null, true]) } Analytics will allow you to filter by OS, browser, and all the other environment data it already captures. And nice graphs…

For some reason I thought they were doing more than this, like proxying your JavaScript (hence PROXino), instrumenting it with try/catches to provide robust stack traces, but apparently not: https://www.proxino.com/p.js

They load in jQuery? That isn't the true third-party javascript way...

Re: Show HN: Proxino -- Monitor and Debug your JavaScript

#38

For hackers: window.onerror = function(m, f, l){ var err = JSON.encode({ message:m, file:f, line:l }) (new Image).src = '/errors?e='+err } For Google Analytics users: window.onerror = function(m, f, l){ var err = [f, l, m].join(' : ') _gaq.push(['_trackEvent', 'Errors', 'App', err, null, true]) } Analytics will allow you to filter by OS, browser, and all the other environment data it already captures. And nice graphs…

How do you keep a nefarious script kiddie from filling up your logs with bogus data? My thoughts were this:

1. Set the window.onerror to immediately push errors to an array 2. Load a small unique script that will create a basic sendError function to post the onerror arguments to an endpoint with a unique csrf set. 3. Loop through the arguments that are queued up and send them to the endpoint. 4. Replace the window.onerror with the sendError function.

Your endpoint can be an API that will log the data to either something like Graylog2 or whatever your favorite logging system is. Not 100% bullet proof but better then nothing.

Re: Show HN: Proxino -- Monitor and Debug your JavaScript

#39
post #16

There are already services (like Sentry) that track errors well. I want a service that focuses on the non-error logging part. I typically develop my JS with a lot of console.log calls. Let's say a hundred at page load, and more for each user action, and when there's new data coming down from the server. I'm trying to fix a bug that my friend is having on my new project, but I can't reproduce it locally. I want to see…

You should take a look at Weinre https://github.com/apache/incubator-cordova-weinre

Re: Show HN: Proxino -- Monitor and Debug your JavaScript

#40
post #39
post #16

There are already services (like Sentry) that track errors well. I want a service that focuses on the non-error logging part. I typically develop my JS with a lot of console.log calls. Let's say a hundred at page load, and more for each user action, and when there's new data coming down from the server. I'm trying to fix a bug that my friend is having on my new project, but I can't reproduce it locally. I want to see…

You should take a look at Weinre https://github.com/apache/incubator-cordova-weinre

Wow, that looks cool. Thanks.
Post reply on HN