Thursday, November 4, 2010

LogWindow 2.0 using LibQxt

I just implemented a small web server for our Qt apps that use LibQxt's QxtWeb classes to serve the application log over HTML.

Static files are served from QResources and log events are fetched by AJAX/jQuery, using a small javascript code to format them into a table in the web server.

Next on the todo-list is to add a dynamic filter by severity/thread/location. Should be pretty easy to get going.

We used an in-application LogWindow before, but that sucks performance wise and it doesn't redraw when debugging the GUI-thread, obviously. This is also way easier than creating and managing an logging application as an entirely different process.

The most recent LibQxt even has a JSONRPCService, which might've been useful. We're using a slightly older one so I manually implemented a WebService which serves JSON or html/css/js.

Anyway, this ought to be cleaned up a bit and contributed back to LibQxt.

No comments :