diff options
author | Martin Panter <vadmium+py@gmail.com> | 2016-07-26 09:18:21 (GMT) |
---|---|---|
committer | Martin Panter <vadmium+py@gmail.com> | 2016-07-26 09:18:21 (GMT) |
commit | 1050d2d0c7730c6c533246bb2404937739a7775c (patch) | |
tree | 68d901cd196aead4df7c3b074ebf2df6e85678e7 /Doc/howto/logging-cookbook.rst | |
parent | 87ec85f4208bf329e6454fd3e2639c613b2b61af (diff) | |
download | cpython-1050d2d0c7730c6c533246bb2404937739a7775c.zip cpython-1050d2d0c7730c6c533246bb2404937739a7775c.tar.gz cpython-1050d2d0c7730c6c533246bb2404937739a7775c.tar.bz2 |
Issue #26462: Doc: reduce literal_block warnings, fix syntax highlighting.
Patch by Julien Palard.
Diffstat (limited to 'Doc/howto/logging-cookbook.rst')
-rw-r--r-- | Doc/howto/logging-cookbook.rst | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/Doc/howto/logging-cookbook.rst b/Doc/howto/logging-cookbook.rst index 99b4cdc..de0d304 100644 --- a/Doc/howto/logging-cookbook.rst +++ b/Doc/howto/logging-cookbook.rst @@ -377,7 +377,9 @@ An example of using these two classes follows (imports omitted):: root.warning('Look out!') listener.stop() -which, when run, will produce:: +which, when run, will produce: + +.. code-block:: none MainThread: Look out! @@ -1860,7 +1862,9 @@ script, ``chowntest.py``:: logger = logging.getLogger('mylogger') logger.debug('A debug message') -To run this, you will probably need to run as ``root``:: +To run this, you will probably need to run as ``root``: + +.. code-block:: shell-session $ sudo python3.3 chowntest.py $ cat chowntest.log @@ -2485,7 +2489,9 @@ via ``stderr`` and once via ``stdout``). After the ``with`` statement's completion, the status is as it was before so message #6 appears (like message #1) whereas message #7 doesn't (just like message #2). -If we run the resulting script, the result is as follows:: +If we run the resulting script, the result is as follows: + +.. code-block:: shell-session $ python logctx.py 1. This should appear just once on stderr. @@ -2495,12 +2501,16 @@ If we run the resulting script, the result is as follows:: 6. This should appear just once on stderr. If we run it again, but pipe ``stderr`` to ``/dev/null``, we see the following, -which is the only message written to ``stdout``:: +which is the only message written to ``stdout``: + +.. code-block:: shell-session $ python logctx.py 2>/dev/null 5. This should appear twice - once on stderr and once on stdout. -Once again, but piping ``stdout`` to ``/dev/null``, we get:: +Once again, but piping ``stdout`` to ``/dev/null``, we get: + +.. code-block:: shell-session $ python logctx.py >/dev/null 1. This should appear just once on stderr. |