Monday, June 22, 2009

Dumpcatcher: Python Client

For the python dumpcatcher client I decided to go with the standard python logging infrastructure. While there was definitely something lacking in the python documentation for I found all the information I needed with a combination of the docs and the source code itself. Creating a python client for the dumpcatcher is now pretty simple:
import handler  # from dumpcatcher.clients.python.logging

logger = logging.getLogger('my_tag')

  'a' + 1  # TypeError!
except Exception, e:
  logger.exception('Oh man! Look at this!')
The output of which looks something like:
2009-06-21 06:36:57 demo 40 Oh man! Look at this! Oh man! Look at this!
Traceback (most recent call last):
File "/home/jlapenna/code/dumpcatcher/clients/python/logging/", line 108, in broken
  'a' + 1
TypeError: cannot concatenate 'str' and 'int' objects
File "/home/jlapenna/code/dumpcatcher/clients/python/logging/", line 110, in broken
  logger.exception('Oh man! Look at this!')
Looking at this now, it seems that all I have left is the java client and data aggregation before I'm feature complete!