1 2 3 4 5 6 7 8 | try { //some code goes here } catch (Exception e) { logToTwitter("Application Name", e.getStackTrace()); } |
It started with one Tweet from me, followed up by and Retweet from Kelly Sutton to actually give it serious thought. Instead of having to view logs, why not have an exception stack trace appear in your Twitter time line? With services like Twitlonger, one can easily shove an entire stack trace into a Tweet. Privacy can be dealt with on Twitter’s side by setting the privacy of the Twitter Bot user. Except if you’re using Twitlonger.
1 2 3 4 5 6 7 8 | try { //some code goes here } catch (Exception e) { logToTwitter("Application name", new Date(), e); } |
Instead of the entire stack trace, you can just get a one-liner of the type of exception it is along with a date/time stamp for references when digging through logs.
I guess the one limiting factor of this is the assumption that whatever app is using this logging method have an internet connection.
In any case, this has given me something to think about. I’d love to see this usefulness in actual applications. With Twitter Lists now enabled, developers can have a whole bunch of logging accounts in a separate list if they don’t want their time line polluted with exceptions. But if they are worried about that, don’t write code that will throw exceptions.

Wait..what? “don’t write code that will throw exceptions”?!?!?!
I hope you actually mean:
“write code that works”
not:
“write code that doesn’t have any exception handling”. . .
Don’t make me come over there and smack you one . . . (JK)
I think this is a really good idea, especially for those developing for mobile platforms.
Haha! There is no exception if you don’t handle the Exception. Learned that from The Matrix.
I guess the other assumption is that twitter won’t drop the message.
I’ll stick with emon
.
Yeah, that is a problem. Does an exception happen if Twitter isn’t up to receive the message? All Hail emon!