I would use Python Loggin -> http://docs.python.org/2/library/logging.html You can format its lines to be ',' delimited, for example
[formatter_generic_form]
format='%(asctime)s , %(levelname)s , %(message)s'
datefmt='%Y-%m-%d %H:%M:%S'
Datetime, level_of_log, whatever_message_you_want_to_log
I recommend you http://docs.python.org/2/howto/logging.html#logging-basic-tutorial to start