7 Feb 2003 follower   » (Journeyer)

Talkback ID functionality in Python (continued)

Thanks for your comments Adrian. Here's some responses... :-)

  • The final "complete" incident id that is generated will probably have the/a version number prepended; I think it's more useful than making it part of the hash itself. The final form is probably something like:
    <ver>--<id>--<line> (e.g. 501-33425-22) where <id> is generated from the hash of the function path. Keeping the version number separate means that exceptions from the same call path in different versions maintain the same id which I think is useful.
  • The final purpose of all this is to create a "catchall uncaught exception handler" so you might not have to make time to do it yourself... :-) Essentially you'll be able to import the handler module, start it (which hooks the exception handler), and register some Reporters. The reporters determine how the otherwise unhandled exception is reported (surprise!). For example, the current very basic reporters display the incident id in the console and email a report to an email address. Other possibilities include writing a log file, paging a tech or displaying a message dialog--which are reporters we're likely to implement. (Could have a direct-to-web option too...)
  • For the purposes we're using the module we don't want to re-raise the exception--we want to supress it completely as far as the user is concerned--but a reporter could be created to display the traceback as per normal behaviour.
  • I also briefly considered embedding a mini-stack trace in the incident id, but decided it would probably make it too long and enumerating the functions would make the system more difficult to use overall.
  • Thanks for mentioning anonymous functions and lambdas, I hadn't specifically thought about them. I haven't checked what the module does with them at the moment, but will have to do so, it depends on how Python reports them in the stack trace...
The module is mostly production ready in its current state, could be ready for release early next week--my employers are happy for it to be GPL'd.

Other stuff...

  • Having an employer that uses and is happy to release open source is cool.
  • Being paid to work with Python is (still) cool.
  • I have no idea what other people think about reading it, but looking at what I've written for this & my last entry maybe I will yet be able to get interested enough about something to actually write something significant about it.

Later...

CodeCon How come it's taken me until now to realise that most of CodeCon takes place over the weekend, not during the week? That sudden realisation has greatly increased the likelihood of me going... (One other question, is it just my imagination or was the original discount price $75?)

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!