Skip to content

Commit

Permalink
Merge doc-howto-logger-typo-7944: Fix logger doc typos.
Browse files Browse the repository at this point in the history
Author: thijs
Reviewer: adiroiban
Fixes: twisted#7944

git-svn-id: svn://svn.twistedmatrix.com/svn/Twisted/trunk@46285 bbbe8e31-12d6-0310-92fd-ac37d47ddeeb
  • Loading branch information
adiroiban committed Nov 19, 2015
1 parent 4b98d0b commit d5589c2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/core/howto/logger.rst
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ Capturing Failures
except:
log.failure("Math is hard!")
The emitted event will have the ``"log_failure"`` key set, which is a :api:`twisted.python.failure.Failure <Failure>` than captures the exception.
This can be used my observers to obtain a traceback.
The emitted event will have the ``"log_failure"`` key set, which is a :api:`twisted.python.failure.Failure <Failure>` that captures the exception.
This can be used by my observers to obtain a traceback.
For example, :api:`twisted.logger.FileLogObserver <FileLogObserver>` will append the traceback to it's output::

Math is hard!
Expand Down Expand Up @@ -178,7 +178,7 @@ These are:
In the first example above, the call to ``log.debug`` will add a ``log_level`` key to the emitted event with a value of :api:`twisted.logger.LogLevel.debug <LogLevel.debug>` .
In the second example, calling ``self.log.error`` would use a value of :api:`twisted.logger.LogLevel.error <LogLevel.error>` .

The above descriptions are simply guidance, but it is worth noting that log levels have a reduced value if they are used inconsistantly.
The above descriptions are simply guidance, but it is worth noting that log levels have a reduced value if they are used inconsistently.
If one module in an application considers a message informational, and another module considers a similar message an error, then filtering based on log levels becomes harder.
This is increasingly likely if the modules in question are developed by different parties, as will often be the case with externally source libraries and frameworks.
(If a module tends to use higher levels than another, namespaces may be used to calibrate the relative use of log levels, but that is obviously suboptimal.)
Expand Down Expand Up @@ -423,7 +423,7 @@ Just always be sure to use event format fields, not string concatenation, to ref
Registering an observer
-----------------------

One way to register an observer is to contruct a :api:`twisted.logger.Logger <Logger>` object with it:
One way to register an observer is to construct a :api:`twisted.logger.Logger <Logger>` object with it:

.. code-block:: python
Expand Down Expand Up @@ -463,7 +463,7 @@ Observers can be registered to be forwarded events by calling the :api:`twisted.
log.info("Hello")
The result here is the same as the previous example, except that addtional observers can be (and may already have been) registered.
The result here is the same as the previous example, except that additional observers can be (and may already have been) registered.
We know that ``"Hello"`` will be printed.
We don't know, but it's very possible, that the same event will also be handled by other observers.

Expand Down
Empty file added twisted/topfiles/7944.misc
Empty file.

0 comments on commit d5589c2

Please sign in to comment.