FAQ
Hi -
I have been struggling with this problem for quite some time and was hoping somebody could give me some pointers.

I have a wxPython front end wizard that collects some information and outputs some HTML pages (not hosted by a web server, but viewable locally on the machine running the application).

The problem that i'm trying to solve is taking data collected along the way and outputting this into these HTML pages.

One of the pages is simply collecting debug information about the execution of the program.
All logging is currently being done using the python logging library.

Due to the fact that my HTML files need to be populated in the <body> tags, I wanted to write directly to the proper HTML page based on the logging level message (INFO, DEBUG, etc).

Something like this works nicely if you have a dictionary storing the data:

def template():
return open("html/html.tmpl", 'r').read() % vars

print template("html/Logs.html", { 'body' : "A test body field" })


But in my case, some of the data could be MB in size and I didn't want to read/write that entire load of data before displaying the pages if at all possible.
I was hoping I could tie the logging classes into something like this, where I was leveraging an HTML template, but also taking advantage of the logging library since it works nicely for me today.

Does anybody have any suggestions on how they might approach this problem?

thanks!

DLP

Search Discussions

  • Gabriel Genellina at Apr 4, 2010 at 3:31 am
    En Sat, 03 Apr 2010 20:42:20 -0300, David LePage <dwlepage at yahoo.com>
    escribi?:
    The problem that i'm trying to solve is taking data collected along the
    way and outputting this into these HTML pages.
    [...]
    I was hoping I could tie the logging classes into something like this,
    where I was leveraging an HTML template, but also taking advantage of
    the logging library since it works nicely for me today.
    Try this recipe:
    http://code.activestate.com/recipes/577025-loggingwebmonitor-a-central-logging-server-and-mon/

    --
    Gabriel Genellina

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedApr 3, '10 at 11:42p
activeApr 4, '10 at 3:31a
posts2
users2
websitepython.org

2 users in discussion

David LePage: 1 post Gabriel Genellina: 1 post

People

Translate

site design / logo © 2022 Grokbase