Mercurial > templog
comparison web/templog.py @ 409:1854abee5a59
add debug url
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 02 Aug 2012 22:11:13 +0800 |
parents | 5026780c2dc7 |
children | 3b4277aaed3c |
comparison
equal
deleted
inserted
replaced
408:88f578f36bde | 409:1854abee5a59 |
---|---|
77 urlparams = urllib.urlencode(request.query) | 77 urlparams = urllib.urlencode(request.query) |
78 return bottle.template('top', urlparams=urlparams, | 78 return bottle.template('top', urlparams=urlparams, |
79 end = end.strftime(DATE_FORMAT), | 79 end = end.strftime(DATE_FORMAT), |
80 length = minutes) | 80 length = minutes) |
81 | 81 |
82 @route('/test') | 82 @route('/debug') |
83 def test(): | 83 def debuglog(): |
84 import config | 84 response.set_header('Content-Type', 'text/plain') |
85 import os | 85 return log.tail_debug_log() |
86 f = open('%s/testout' % config.DATA_PATH, 'a+') | |
87 f.write("more") | |
88 f.flush() | |
89 f.close() | |
90 | |
91 return 'done' | |
92 | 86 |
93 def main(): | 87 def main(): |
94 #bottle.debug(True) | 88 #bottle.debug(True) |
95 #bottle.run(reloader=True) | 89 #bottle.run(reloader=True) |
96 bottle.run(server='cgi', reloader=True) | 90 bottle.run(server='cgi', reloader=True) |