Ticket #5677: 5677.2.diff

File 5677.2.diff, 1.5 KB (added by Tim Graham, 14 years ago)

updated danielr's patch to apply cleanly trunk

  • docs/howto/deployment/modpython.txt

    diff --git a/docs/howto/deployment/modpython.txt b/docs/howto/deployment/modpython.txt
    index 90a85ca..0f5447f 100644
    a b everything for each request. But don't do that on a production server, or we'll  
    211211revoke your Django privileges.
    212212
    213213If you're the type of programmer who debugs using scattered ``print``
    214 statements, note that ``print`` statements have no effect in mod_python; they
    215 don't appear in the Apache log, as one might expect. If you have the need to
    216 print debugging information in a mod_python setup, either do this::
     214statements, note that writing to ``stdout`` with a regular ``print`` statement
     215is a bad idea.  Things written in this fashion will not appear in the Apache
     216log, as one might expect.
    217217
    218     assert False, the_value_i_want_to_see
     218If you have the need to print debugging information in a mod_python setup, you
     219have three options.  The first is to print to ``stderr`` explicitly, like so::
    219220
    220 Or add the debugging information to the template of your page.
     221    print >> sys.stderr, 'debug text'
     222    sys.stderr.flush()
     223
     224Note that ``stderr`` is buffered, so calling ``flush`` is necessary if you wish
     225debugging information to be displayed promptly.
     226
     227A second, more compact approach is to use an assertion::
     228
     229    assert False, 'debug text'
     230
     231The third option is to add debugging information to the template of your page.
    221232
    222233.. _mod_python documentation: http://modpython.org/live/current/doc-html/directives.html
    223234
Back to Top