Strange behavior with os call in cgi script

Vinay Sajip vinay_sajip at yahoo.co.uk
Tue Feb 7 18:13:01 EST 2006


Rene Pijlman wrote:
> It struck me as somewhat complicated as well.
>
> Looking at the basic example:
> http://www.python.org/doc/2.3.5/lib/node304.html
>
> ... the things that first-time users shouldn't be bothered with IMO are:
>
> 1. Getting a logger by name from a hierarchical namespace. There should be
> a module-level log function that logs through the root logger.
> 2. Formatting the message (use a sensible default)
> 3. Adding a handler to a logger (artefact of the logging system).
> 4. Setting a log level (use a sensible default).
>
> Perhaps there should be some module-level functions that make it easier to
> 'just log this message to that file'.
>
> But I do think that adding logging to a cgi script is a sensible thing to
> do for a beginner. Getting that to run in a debugger is probably way more
> complicated.

You should look at later versions of Python - your points above about
easier configuration have already been addressed: here's a link from
the current (2.4) docs:

http://docs.python.org/lib/minimal-example.html

Regards,

Vinay Sajip




More information about the Python-list mailing list