aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.mkd6
-rw-r--r--libpathod/app.py7
2 files changed, 13 insertions, 0 deletions
diff --git a/README.mkd b/README.mkd
index 0c5f2eb4..bf5634ba 100644
--- a/README.mkd
+++ b/README.mkd
@@ -284,6 +284,12 @@ Where each entry looks like this:
'started': 1335735586.469218
}
+You can preview the JSON data returned for a log entry through the built-in web
+interface.
+
+### /api/log/clear
+
+A POST to this URL clears the log buffer.
# Installing
diff --git a/libpathod/app.py b/libpathod/app.py
index 7059f9ba..ca24c62c 100644
--- a/libpathod/app.py
+++ b/libpathod/app.py
@@ -12,6 +12,12 @@ class APILog(tornado.web.RequestHandler):
)
+class APILogClear(tornado.web.RequestHandler):
+ def post(self):
+ self.application.clear_log()
+ self.write("OK")
+
+
class _Page(tornado.web.RequestHandler):
def render(self, name, **kwargs):
tornado.web.RequestHandler.render(self, name + ".html", **kwargs)
@@ -129,6 +135,7 @@ class PathodApp(tornado.web.Application):
(r"/help", Help),
(r"/preview", Preview),
(r"/api/log", APILog),
+ (r"/api/log/clear", APILogClear),
(r"/p/.*", RequestPathod, settings),
],
static_path = utils.data.path("static"),