Commit 8181191aeed47706543d65a4c5903aadc3799255

  • avatar
  • arvind
  • Fri Feb 08 11:28:37 IST 2013
Adding feature
			 - Flask app will log the errors on to a log file now.  Don't have to depend on apache to do it and spend hours on debugging in production.
  • Diff rendering mode:
  • inline
  • side by side

fetch.py

2from flask import request2from flask import request
3from flask import render_template3from flask import render_template
4from flask import make_response4from flask import make_response
5from logging import FileHandler
5import json6import json
6import pymongo7import pymongo
7import os8import os
61 return i.split('/')[-1]61 return i.split('/')[-1]
62 ls = map(sanitize, ls)62 ls = map(sanitize, ls)
63 return render_template('history.html', ls=ls)63 return render_template('history.html', ls=ls)
64
65#Log the errors, don't depend on apache to log it for you.
66fil = FileHandler(os.path.join(os.path.dirname(__file__),'logme'),mode='a')
67fil.setLevel(logging.ERROR)
68app.logger.addHandler(fil)
6469
6570
66if __name__ == "__main__":71if __name__ == "__main__":